diff --git a/libc/net/lib_inetntoa.c b/libc/net/lib_inetntoa.c index f04c3a48ff..9e763de6b4 100644 --- a/libc/net/lib_inetntoa.c +++ b/libc/net/lib_inetntoa.c @@ -65,16 +65,16 @@ FAR char *inet_ntoa(struct in_addr in) { static char buffer[INET_ADDRSTRLEN+2]; - FAR char *ptr = (FAR char*)&in.s_addr; - sprintf(buffer, "%d.%d.%d.%d", ptr[0], ptr[1], ptr[2], ptr[3]); + FAR unsigned char *ptr = (FAR unsigned char*)&in.s_addr; + sprintf(buffer, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]); return buffer; } #else FAR char *_inet_ntoa(in_addr_t in) { static char buffer[INET_ADDRSTRLEN+2]; - FAR char *ptr = (FAR char*)∈ - sprintf(buffer, "%d.%d.%d.%d", ptr[0], ptr[1], ptr[2], ptr[3]); + FAR unsigned char *ptr = (FAR unsigned char*)∈ + sprintf(buffer, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]); return buffer; } #endif