summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-05-06 13:01:31 +0000
committerglebius <glebius@FreeBSD.org>2005-05-06 13:01:31 +0000
commit62a51b2dbfae6d0578f56ce591c330862ec2374e (patch)
treec863881a8c2fee33b26b5c129abdb0bce013ac7b /sys/netinet/libalias
parent6cf7e8d0ccd263845f062f2b9c72122c25956af7 (diff)
downloadFreeBSD-src-62a51b2dbfae6d0578f56ce591c330862ec2374e.zip
FreeBSD-src-62a51b2dbfae6d0578f56ce591c330862ec2374e.tar.gz
Add a workaround for 64-bit archs: store unsigned long return value in
temporary variable, check it and then cast to in_addr_t.
Diffstat (limited to 'sys/netinet/libalias')
-rw-r--r--sys/netinet/libalias/alias_proxy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/libalias/alias_proxy.c b/sys/netinet/libalias/alias_proxy.c
index a60b79f..b2789f3 100644
--- a/sys/netinet/libalias/alias_proxy.c
+++ b/sys/netinet/libalias/alias_proxy.c
@@ -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
OpenPOWER on IntegriCloud