mirror of
https://github.com/apache/nuttx.git
synced 2026-09-02 07:03:04 +00:00
inet_ntop: Was printing negative values for fields >127.
This commit is contained in:
parent
ae33247f47
commit
fdca465da6
1 changed files with 2 additions and 2 deletions
|
|
@ -100,7 +100,7 @@
|
|||
#if defined(CONFIG_NET_IPv4) || defined(CONFIG_LIBC_IPv4_ADDRCONV)
|
||||
static int inet_ipv4_ntop(FAR const void *src, FAR char *dest, socklen_t size)
|
||||
{
|
||||
FAR char *ptr;
|
||||
FAR uint8_t *ptr;
|
||||
|
||||
if (size < INET_ADDRSTRLEN)
|
||||
{
|
||||
|
|
@ -108,7 +108,7 @@ static int inet_ipv4_ntop(FAR const void *src, FAR char *dest, socklen_t size)
|
|||
}
|
||||
|
||||
ptr = (FAR char *)src;
|
||||
sprintf(dest, "%d.%d.%d.%d", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
sprintf(dest, "%u.%u.%u.%u", ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue