Fix an assertion

This commit is contained in:
Gregory Nutt
2015-07-08 16:00:50 -06:00
parent 299782e8ec
commit 1cd4ef1730
+2
View File
@@ -82,6 +82,8 @@ FAR struct hostent *gethostbyaddr(FAR const void *addr, socklen_t len, int type)
int ret;
DEBUGASSERT(addr != NULL);
DEBUGASSERT(type == AF_INET || type == AF_INET6);
ret = gethostbyaddr_r(addr, len, type, &g_hostent, g_hostbuffer,
CONFIG_NETDB_BUFSIZE, &h_errno);
return ret == 0 ? &g_hostent : NULL;