|
3 | 3 | *is for IP V4 CIDR notation, but prepared for V6: just
|
4 | 4 | *add the necessary bits where the comments indicate.
|
5 | 5 | *
|
6 |
| - *$Id: network.c,v 1.3 1998/10/2904:41:44 momjian Exp $ |
| 6 | + *$Id: network.c,v 1.4 1998/10/2916:13:07 tgl Exp $ |
7 | 7 | *Jon Postel RIP 16 Oct 1998
|
8 | 8 | */
|
9 | 9 |
|
@@ -397,7 +397,7 @@ network_network(inet *ip)
|
397 | 397 | /* It's an IP V4 address: */
|
398 | 398 | intaddr=htonl(ntohl(ip_v4addr(ip))& (0xffffffff << (32-ip_bits(ip))));
|
399 | 399 |
|
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) |
401 | 401 | {
|
402 | 402 | elog(ERROR,"unable to print network (%s)",strerror(errno));
|
403 | 403 | return (NULL);
|
|