diff options
author | jsg <> | 2015-05-14 11:52:43 +0000 |
---|---|---|
committer | jsg <> | 2015-05-14 11:52:43 +0000 |
commit | dfd58b2d262bb801a9048813d922b51c08607ba1 (patch) | |
tree | bf21896a5a8a6bef389cd3e441aa9690a6877d9d | |
parent | 8e6b6e9a475e1dc36b40779a796041d17cbff6c2 (diff) | |
download | openbsd-dfd58b2d262bb801a9048813d922b51c08607ba1.tar.gz openbsd-dfd58b2d262bb801a9048813d922b51c08607ba1.tar.bz2 openbsd-dfd58b2d262bb801a9048813d922b51c08607ba1.zip |
rev 1.3 introduced a check to an if statement without adding braces.
Claudio points out the size is checked by an earlier test so just
remove it to restore the original handling of the partial octet case.
Discussed with claudio and gilles.
-rw-r--r-- | src/lib/libc/net/inet_net_ntop.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/libc/net/inet_net_ntop.c b/src/lib/libc/net/inet_net_ntop.c index 35ae7909d3..652b24076e 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.7 2012/06/22 19:13:37 gilles Exp $ */ | 1 | /* $OpenBSD: inet_net_ntop.c,v 1.8 2015/05/14 11:52:43 jsg 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> |
@@ -114,8 +114,6 @@ inet_net_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size) | |||
114 | if (ep - dst < sizeof ".255") | 114 | if (ep - dst < sizeof ".255") |
115 | goto emsgsize; | 115 | goto emsgsize; |
116 | if (dst != odst) | 116 | if (dst != odst) |
117 | if (dst + 1 >= ep) | ||
118 | goto emsgsize; | ||
119 | *dst++ = '.'; | 117 | *dst++ = '.'; |
120 | m = ((1 << b) - 1) << (8 - b); | 118 | m = ((1 << b) - 1) << (8 - b); |
121 | advance = snprintf(dst, ep - dst, "%u", *src & m); | 119 | advance = snprintf(dst, ep - dst, "%u", *src & m); |