diff options
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/dhcpc.c | 4 | ||||
-rw-r--r-- | networking/udhcp/files.c | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 9ab6aee..f2cf82f 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -262,10 +262,10 @@ int udhcpc_main(int argc, char *argv[]) client_config.script = optarg; break; case 'T': - client_config.timeout = atoi(optarg); + client_config.timeout = xatoi_u(optarg); break; case 't': - client_config.retries = atoi(optarg); + client_config.retries = xatoi_u(optarg); break; case 'v': printf("version %s\n\n", BB_VER); diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c index d9dfb89..52d3838 100644 --- a/networking/udhcp/files.c +++ b/networking/udhcp/files.c @@ -35,7 +35,8 @@ static int read_ip(const char *line, void *arg) int retval = 1; if (!inet_aton(line, addr)) { - if ((host = gethostbyname(line))) + host = gethostbyname(line); + if (host) addr->s_addr = *((unsigned long *) host->h_addr_list[0]); else retval = 0; } @@ -72,10 +73,7 @@ static int read_str(const char *line, void *arg) static int read_u32(const char *line, void *arg) { - uint32_t *dest = arg; - char *endptr; - *dest = strtoul(line, &endptr, 0); - return endptr[0] == '\0'; + return safe_strtou32(line, (uint32_t*)arg) == 0; } |