summaryrefslogtreecommitdiff
path: root/networking/udhcp/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/files.c')
-rw-r--r--networking/udhcp/files.c8
1 files changed, 3 insertions, 5 deletions
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;
}