net/socket/getsockname.c: Fix addrlen check in socket debug features. Getsockname checked erroneously a pointer agains 0, where the intention was to dereference the pointer and to check the length. This causes also a compilation failure if the code is compiled with CONFIG_DEBUG_FEATURES and with -Werror flag set.
This commit is contained in:
parent
fb9ee031fe
commit
285fb555d0
|
@ -105,7 +105,7 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr, FAR s
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (addr == NULL || addrlen <= 0)
|
||||
if (addr == NULL || *addrlen <= 0)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue