Skip to content

Commit 4b1fe23

Browse files
committed
Prevent compiler warning from sprintf in recent ipv6 patch.
1 parent 945543d commit 4b1fe23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/inet_net_ntop.c

Lines changed: 3 additions & 3 deletions
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.13 2003/06/24 22:21:22 momjian Exp $";
19+
static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.14 2003/06/24 22:42:42 momjian Exp $";
2020
#endif
2121

2222
#include "postgres.h"
@@ -270,9 +270,9 @@ inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
270270

271271
if (!double_colon) {
272272
if (bits < 128 - 32)
273-
cp += SPRINTF((cp, "::", bits));
273+
cp += SPRINTF((cp, "::%d", bits));
274274
else if (bits < 128 - 16)
275-
cp += SPRINTF((cp, ":0", bits));
275+
cp += SPRINTF((cp, ":0%d", bits));
276276
}
277277

278278
/* Format CIDR /width. */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy