diff options
| author | deraadt <> | 2019-07-03 03:24:04 +0000 |
|---|---|---|
| committer | deraadt <> | 2019-07-03 03:24:04 +0000 |
| commit | ef84a12d8fc3f2dacb57102d5f84bfb4025a320a (patch) | |
| tree | 095ed8468464d046dbf7618376c0a18af76dceba /src/lib/libc | |
| parent | 88ab3711341dea97a3118b0654ceab1679d5e0a1 (diff) | |
| download | openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.tar.gz openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.tar.bz2 openbsd-ef84a12d8fc3f2dacb57102d5f84bfb4025a320a.zip | |
snprintf/vsnprintf return < 0 on error, rather than -1.
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/inet_net_ntop.c | 4 |
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 | } |
