Change long2ip return type (#13395)

This commit is contained in:
Jorg Adam Sowa 2024-02-16 17:11:18 +01:00 committed by GitHub
parent eaaffae555
commit e7b1f2a95b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 9 deletions

View file

@ -643,11 +643,10 @@ PHP_FUNCTION(long2ip)
ip = (zend_ulong)sip;
myaddr.s_addr = htonl(ip);
if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
RETURN_STRING(str);
} else {
RETURN_FALSE;
}
const char* result = inet_ntop(AF_INET, &myaddr, str, sizeof(str));
ZEND_ASSERT(result != NULL);
RETURN_STRING(str);
}
/* }}} */