Fix: inet_ntop passed the wrong pointer

This commit is contained in:
CPunch 2022-04-15 00:25:36 -05:00
parent 9d083608aa
commit 7bd256171b
1 changed files with 2 additions and 2 deletions

View File

@ -160,8 +160,8 @@ void laikaS_acceptFrom(struct sLaika_socket *sock, struct sLaika_socket *from, c
LAIKA_ERROR("accept() failed!\n");
/* read ipv4 */
if (ipv4 != NULL) {
if (inet_ntop(AF_INET, &address, ipv4, LAIKA_IPV4_LEN) == NULL)
if (ipv4) {
if (inet_ntop(AF_INET, &address.sin_addr, ipv4, LAIKA_IPV4_LEN) == NULL)
LAIKA_ERROR("inet_ntop() failed!\n");
/* restore null terminator */