FIX socket_get_id generates always empty string on linux

This commit is contained in:
fefux 2026-05-17 13:24:21 +02:00 committed by GitHub
parent 6092488d1c
commit c4e52b331f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,7 +201,7 @@ static s64 ns_socket_get_id(UNUSED u8 localId) {
static char* ns_socket_get_id_str(u8 localId) {
if (localId == UNKNOWN_LOCAL_INDEX) { localId = 0; }
static char id_str[INET6_ADDRSTRLEN] = { 0 };
snprintf(id_str, INET6_ADDRSTRLEN, "%s", inet_ntop(AF_INET6, &sAddr[localId].sin6_addr, id_str, sizeof(id_str)));
inet_ntop(AF_INET6, &sAddr[localId].sin6_addr, id_str, sizeof(id_str));
return id_str;
}