compiler warning fix

This commit is contained in:
Yang Tse
2007-02-02 17:16:06 +00:00
parent 8337a375dd
commit c26ec47e90
4 changed files with 9 additions and 6 deletions

View File

@@ -305,7 +305,7 @@ static char *lookup_service(unsigned short port, int flags,
strcpy(tmpbuf, sep->s_name);
else
/* get port as a string */
sprintf(tmpbuf, "%u", ntohs(port));
sprintf(tmpbuf, "%u", (unsigned short)ntohs(port));
if (strlen(tmpbuf) < buflen)
/* return it if buffer big enough */
strcpy(buf, tmpbuf);