diff options
author | 2019-07-03 03:24:01 +0000 | |
---|---|---|
committer | 2019-07-03 03:24:01 +0000 | |
commit | 515e489c3d599b9cfcdf9cf6842ac49f92e154d6 (patch) | |
tree | 9ce211473951e1baf5c99e08c2c35012292670f1 /lib/libc/net/inet_net_ntop.c | |
parent | sync (diff) | |
download | wireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.tar.xz wireguard-openbsd-515e489c3d599b9cfcdf9cf6842ac49f92e154d6.zip |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'lib/libc/net/inet_net_ntop.c')
-rw-r--r-- | lib/libc/net/inet_net_ntop.c | 4 |
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); } |