1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-21 20:40:05 +00:00

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

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 */