diff --git a/Modules/getnameinfo.c b/Modules/getnameinfo.c index 182a3bff9e3..33d6ad3084f 100644 --- a/Modules/getnameinfo.c +++ b/Modules/getnameinfo.c @@ -130,7 +130,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) if (serv == NULL || servlen == 0) { /* what we should do? */ } else if (flags & NI_NUMERICSERV) { - snprintf(numserv, sizeof(numserv), "%d", ntohs(port)); + sprintf(numserv, "%d", ntohs(port)); if (strlen(numserv) > servlen) return ENI_MEMORY; strcpy(serv, numserv);