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

Commit 9e38dcf

Browse files
committed
Re-fix test for negative-integer return code that should be
testing for null-pointer return code...
1 parent 374d9a1 commit 9e38dcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/network.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* is for IP V4 CIDR notation, but prepared for V6: just
44
* add the necessary bits where the comments indicate.
55
*
6-
* $Id: network.c,v 1.3 1998/10/29 04:41:44 momjian Exp $
6+
* $Id: network.c,v 1.4 1998/10/29 16:13:07 tgl Exp $
77
* Jon Postel RIP 16 Oct 1998
88
*/
99

@@ -397,7 +397,7 @@ network_network(inet *ip)
397397
/* It's an IP V4 address: */
398398
int addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff << (32 - ip_bits(ip))));
399399

400-
if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) < 0)
400+
if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) == NULL)
401401
{
402402
elog(ERROR, "unable to print network (%s)", strerror(errno));
403403
return (NULL);

0 commit comments

Comments
 (0)