aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-05-25 05:29:38 +0000
committerBruce Momjian <bruce@momjian.us>1999-05-25 05:29:38 +0000
commit6bf0db7e07f6646bb1fe951bf4a274b98f4ca518 (patch)
treeff24e1318beff37ebf7caab25f97c232c3832287 /src
parent9432b6dd64b521276dc8e1fd37bc66853c93073d (diff)
downloadpostgresql-6bf0db7e07f6646bb1fe951bf4a274b98f4ca518.tar.gz
postgresql-6bf0db7e07f6646bb1fe951bf4a274b98f4ca518.zip
FIx for 0.0.0.0/0 output as 00/0.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/inet_net_ntop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/inet_net_ntop.c b/src/backend/utils/adt/inet_net_ntop.c
index d8cd2ff4497..8c185dc83ca 100644
--- a/src/backend/utils/adt/inet_net_ntop.c
+++ b/src/backend/utils/adt/inet_net_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.4 1999/01/01 04:17:13 momjian Exp $";
+static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.5 1999/05/25 05:29:38 momjian Exp $";
#endif
@@ -207,7 +207,7 @@ inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
/* Format whole octets plus nonzero trailing octets. */
tb = (bits == 32) ? 31 : bits;
- for (b = 0; b <= (tb / 8) || (b < len && *src != 0); b++)
+ for (b = 0; bits != 0 && (b <= (tb / 8) || (b < len && *src != 0)); b++)
{
if (size < sizeof "255.")
goto emsgsize;