summaryrefslogtreecommitdiff
path: root/src/lib/libc/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net')
-rw-r--r--src/lib/libc/net/inet_net_ntop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/inet_net_ntop.c b/src/lib/libc/net/inet_net_ntop.c
index 652b24076e..1f1c4bed12 100644
--- a/src/lib/libc/net/inet_net_ntop.c
+++ b/src/lib/libc/net/inet_net_ntop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: inet_net_ntop.c,v 1.8 2015/05/14 11:52:43 jsg Exp $ */ 1/* $OpenBSD: inet_net_ntop.c,v 1.9 2019/07/03 03:24:04 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2012 by Gilles Chehade <gilles@openbsd.org> 4 * Copyright (c) 2012 by Gilles Chehade <gilles@openbsd.org>
@@ -151,7 +151,7 @@ inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
151 return (NULL); 151 return (NULL);
152 152
153 ret = snprintf(dst, size, "%s/%d", buf, bits); 153 ret = snprintf(dst, size, "%s/%d", buf, bits);
154 if (ret == -1 || ret >= size) { 154 if (ret < 0 || ret >= size) {
155 errno = EMSGSIZE; 155 errno = EMSGSIZE;
156 return (NULL); 156 return (NULL);
157 } 157 }