Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6bf0db7

Browse files
committed
FIx for 0.0.0.0/0 output as 00/0.
1 parent 9432b6d commit 6bf0db7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/inet_net_ntop.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#if defined(LIBC_SCCS) && !defined(lint)
19-
static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.4 1999/01/01 04:17:13 momjian Exp $";
19+
static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.5 1999/05/25 05:29:38 momjian Exp $";
2020

2121
#endif
2222

@@ -207,7 +207,7 @@ inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
207207

208208
/* Format whole octets plus nonzero trailing octets. */
209209
tb = (bits == 32) ? 31 : bits;
210-
for (b = 0; b <= (tb / 8) || (b < len && *src != 0); b++)
210+
for (b = 0; bits != 0 && (b <= (tb / 8) || (b < len && *src != 0)); b++)
211211
{
212212
if (size < sizeof "255.")
213213
goto emsgsize;

0 commit comments

Comments
 (0)