Add a workaround for 64-bit archs: store unsigned long return value in
temporary variable, check it and then cast to in_addr_t.
This commit is contained in:
parent
6cf7e8d0cc
commit
62a51b2dbf
@ -175,11 +175,14 @@ inet_aton(cp, addr)
|
||||
*/
|
||||
gotend = 0;
|
||||
while (!gotend) {
|
||||
val = strtoul(c, &endptr, 0);
|
||||
unsigned long l;
|
||||
|
||||
if (val == ULONG_MAX || val == 0)
|
||||
l = strtoul(c, &endptr, 0);
|
||||
|
||||
if (l == ULONG_MAX || l == 0)
|
||||
return (0);
|
||||
|
||||
|
||||
val = (in_addr_t)l;
|
||||
/*
|
||||
* If the whole string is invalid, endptr will equal
|
||||
* c.. this way we can make sure someone hasn't
|
||||
|
Loading…
Reference in New Issue
Block a user