--- net/getnameinfo.c	2000/07/05 05:09:17	1.5
+++ net/getnameinfo.c	2000/09/25 23:04:36	1.6
@@ -154,12 +153,12 @@
 				(flags & NI_DGRAM) ? "udp" : "tcp");
 		}
 		if (sp) {
-			if (strlen(sp->s_name) > servlen)
+			if (strlen(sp->s_name) + 1 > servlen)
 				return ENI_MEMORY;
 			strcpy(serv, sp->s_name);
 		} else {
 			snprintf(numserv, sizeof(numserv), "%d", ntohs(port));
-			if (strlen(numserv) > servlen)
+			if (strlen(numserv) + 1 > servlen)
 				return ENI_MEMORY;
 			strcpy(serv, numserv);
 		}
@@ -253,7 +252,7 @@
 					*p = '\0';
 			}
 #endif
-			if (strlen(hp->h_name) > hostlen) {
+			if (strlen(hp->h_name) + 1 > hostlen) {
 				freehostent(hp);
 				return ENI_MEMORY;
 			}
