summaryrefslogtreecommitdiff
path: root/lib/libc/net/getnameinfo.c
diff options
context:
space:
mode:
authorYoshinobu Inoue <shin@FreeBSD.org>2000-02-19 16:10:16 +0000
committerYoshinobu Inoue <shin@FreeBSD.org>2000-02-19 16:10:16 +0000
commit0ca229d64d13381cb45c8e73c54fd8bd67aa92d8 (patch)
tree72f8866991d9743af43e911a9f11186d62ceb921 /lib/libc/net/getnameinfo.c
parent6d939e82e0d6b54be01c0c7323db0c4c0121a82b (diff)
Notes
Diffstat (limited to 'lib/libc/net/getnameinfo.c')
-rw-r--r--lib/libc/net/getnameinfo.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c
index 42f7906ee9f9..5edcffb9498c 100644
--- a/lib/libc/net/getnameinfo.c
+++ b/lib/libc/net/getnameinfo.c
@@ -199,14 +199,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
+ scopelen > hostlen)
return ENI_MEMORY;
/*
- * Shift the host string to allocate
- * space for the scope ID part.
+ * Construct <numeric-addr><delim><scopeid>
*/
- memmove(host + scopelen + 1, host, numaddrlen);
- /* copy the scope ID and the delimiter */
- memcpy(host, ifname, scopelen);
- host[scopelen] = SCOPE_DELIMITER;
- host[scopelen + 1 + numaddrlen] = '\0';
+ memcpy(host + numaddrlen + 1, ifname, scopelen);
+ host[numaddrlen] = SCOPE_DELIMITER;
+ host[numaddrlen + 1 + scopelen] = '\0';
}
}
#endif /* INET6 */