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:
Jukka Laitinen 2019-04-30 06:22:07 -06:00 committed by Gregory Nutt
parent fb9ee031fe
commit 285fb555d0
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}