comparison svr-runopts.c @ 492:b956d6151600

Replace calls to strtoul() with a helper m_str_to_uint()
author Matt Johnston <matt@ucc.asn.au>
date Mon, 22 Sep 2008 14:13:44 +0000
parents 7e43f5e473b9
children 6cd2152aae0b b85507ade010
comparison
equal deleted inserted replaced
491:9dbc0c443497 492:b956d6151600
282 282
283 } 283 }
284 284
285 if (recv_window_arg) { 285 if (recv_window_arg) {
286 opts.recv_window = atol(recv_window_arg); 286 opts.recv_window = atol(recv_window_arg);
287 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) 287 if (opts.recv_window == 0 || opts.recv_window > MAX_RECV_WINDOW) {
288 {
289 dropbear_exit("Bad recv window '%s'", recv_window_arg); 288 dropbear_exit("Bad recv window '%s'", recv_window_arg);
290 } 289 }
291 } 290 }
292 291
293 if (keepalive_arg) { 292 if (keepalive_arg) {
294 opts.keepalive_secs = strtoul(keepalive_arg, NULL, 10); 293 if (m_str_to_uint(keepalive_arg, &opts.keepalive_secs) == DROPBEAR_FAILURE) {
295 if (opts.keepalive_secs == 0 && errno == EINVAL)
296 {
297 dropbear_exit("Bad keepalive '%s'", keepalive_arg); 294 dropbear_exit("Bad keepalive '%s'", keepalive_arg);
298 } 295 }
299 } 296 }
300 } 297 }
301 298