mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Re-fix test for negative-integer return code that should be
testing for null-pointer return code...
This commit is contained in:
parent
374d9a1f2b
commit
9e38dcfd43
@ -3,7 +3,7 @@
|
|||||||
* is for IP V4 CIDR notation, but prepared for V6: just
|
* is for IP V4 CIDR notation, but prepared for V6: just
|
||||||
* add the necessary bits where the comments indicate.
|
* add the necessary bits where the comments indicate.
|
||||||
*
|
*
|
||||||
* $Id: network.c,v 1.3 1998/10/29 04:41:44 momjian Exp $
|
* $Id: network.c,v 1.4 1998/10/29 16:13:07 tgl Exp $
|
||||||
* Jon Postel RIP 16 Oct 1998
|
* Jon Postel RIP 16 Oct 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ network_network(inet *ip)
|
|||||||
/* It's an IP V4 address: */
|
/* It's an IP V4 address: */
|
||||||
int addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff << (32 - ip_bits(ip))));
|
int addr = htonl(ntohl(ip_v4addr(ip)) & (0xffffffff << (32 - ip_bits(ip))));
|
||||||
|
|
||||||
if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) < 0)
|
if (inet_cidr_ntop(AF_INET, &addr, ip_bits(ip), tmp, sizeof(tmp)) == NULL)
|
||||||
{
|
{
|
||||||
elog(ERROR, "unable to print network (%s)", strerror(errno));
|
elog(ERROR, "unable to print network (%s)", strerror(errno));
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user