aboutsummaryrefslogtreecommitdiff
path: root/src/backend/port/inet_aton.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/port/inet_aton.c')
-rw-r--r--src/backend/port/inet_aton.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/port/inet_aton.c b/src/backend/port/inet_aton.c
index 0cf6e15dae5..ae954887c26 100644
--- a/src/backend/port/inet_aton.c
+++ b/src/backend/port/inet_aton.c
@@ -1,4 +1,4 @@
-/* $Id: inet_aton.c,v 1.14 1998/02/26 04:34:04 momjian Exp $
+/* $Id: inet_aton.c,v 1.15 1998/09/01 03:24:28 momjian Exp $
*
* This inet_aton() function was taken from the GNU C library and
* incorporated into Postgres for those systems which do not have this
@@ -104,7 +104,7 @@ inet_aton(const char *cp, struct in_addr * addr)
* 16-bits) a.b (with b treated as 24 bits)
*/
if (pp >= parts + 3 || val > 0xff)
- return (0);
+ return 0;
*pp++ = val, cp++;
}
else
@@ -115,7 +115,7 @@ inet_aton(const char *cp, struct in_addr * addr)
* Check for trailing characters.
*/
if (*cp && (!isascii(*cp) || !isspace(*cp)))
- return (0);
+ return 0;
/*
* Concoct the address according to the number of parts specified.
@@ -129,23 +129,23 @@ inet_aton(const char *cp, struct in_addr * addr)
case 2: /* a.b -- 8.24 bits */
if (val > 0xffffff)
- return (0);
+ return 0;
val |= parts[0] << 24;
break;
case 3: /* a.b.c -- 8.8.16 bits */
if (val > 0xffff)
- return (0);
+ return 0;
val |= (parts[0] << 24) | (parts[1] << 16);
break;
case 4: /* a.b.c.d -- 8.8.8.8 bits */
if (val > 0xff)
- return (0);
+ return 0;
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
break;
}
if (addr)
addr->s_addr = htonl(val);
- return (1);
+ return 1;
}