summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-07-03 03:24:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-07-03 03:24:05 +0000
commit75fca2aa3a35362ecff27f0c3041d3f511b51275 (patch)
treed0c647e96313c8d94edf3f50304b78ae1cf249c1 /lib/libc/net
parentaef6c060ee15355c0490999de3c4679d7bb97e84 (diff)
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/inet_net_ntop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/net/inet_net_ntop.c b/lib/libc/net/inet_net_ntop.c
index 652b24076e6..1f1c4bed127 100644
--- a/lib/libc/net/inet_net_ntop.c
+++ b/lib/libc/net/inet_net_ntop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet_net_ntop.c,v 1.8 2015/05/14 11:52:43 jsg Exp $ */
+/* $OpenBSD: inet_net_ntop.c,v 1.9 2019/07/03 03:24:04 deraadt Exp $ */
/*
* 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)
return (NULL);
ret = snprintf(dst, size, "%s/%d", buf, bits);
- if (ret == -1 || ret >= size) {
+ if (ret < 0 || ret >= size) {
errno = EMSGSIZE;
return (NULL);
}