summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/inet_pton.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/inet_pton.c')
-rw-r--r--src/lib/libc/net/inet_pton.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libc/net/inet_pton.c b/src/lib/libc/net/inet_pton.c
index 096ff65772..7e521c3286 100644
--- a/src/lib/libc/net/inet_pton.c
+++ b/src/lib/libc/net/inet_pton.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: inet_pton.c,v 1.7 2006/12/30 23:37:37 itojun Exp $ */ 1/* $OpenBSD: inet_pton.c,v 1.8 2010/05/06 15:47:14 claudio Exp $ */
2 2
3/* Copyright (c) 1996 by Internet Software Consortium. 3/* Copyright (c) 1996 by Internet Software Consortium.
4 * 4 *
@@ -114,8 +114,7 @@ inet_pton4(const char *src, u_char *dst)
114 * return: 114 * return:
115 * 1 if `src' is a valid [RFC1884 2.2] address, else 0. 115 * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
116 * notice: 116 * notice:
117 * (1) does not touch `dst' unless it's returning 1. 117 * does not touch `dst' unless it's returning 1.
118 * (2) :: in a full address is silently ignored.
119 * credit: 118 * credit:
120 * inspired by Mark Andrews. 119 * inspired by Mark Andrews.
121 * author: 120 * author:
@@ -199,6 +198,8 @@ inet_pton6(const char *src, u_char *dst)
199 const int n = tp - colonp; 198 const int n = tp - colonp;
200 int i; 199 int i;
201 200
201 if (tp == endp)
202 return (0);
202 for (i = 1; i <= n; i++) { 203 for (i = 1; i <= n; i++) {
203 endp[- i] = colonp[n - i]; 204 endp[- i] = colonp[n - i];
204 colonp[n - i] = 0; 205 colonp[n - i] = 0;