mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-26 12:16:20 +00:00
refactor: use inet_ntop
This commit is contained in:
parent
e81639ca03
commit
5df71eee42
1 changed files with 2 additions and 2 deletions
|
@ -312,7 +312,7 @@ void SlippiMatchmaking::startMatchmaking()
|
|||
char lan_addr[30] = "";
|
||||
|
||||
char host[256];
|
||||
char* ip = static_cast<char*>(malloc(16));
|
||||
char ip[INET_ADDRSTRLEN] = "";
|
||||
struct hostent* host_entry;
|
||||
int hostname;
|
||||
hostname = gethostname(host, sizeof(host)); // find the host name
|
||||
|
@ -333,7 +333,7 @@ void SlippiMatchmaking::startMatchmaking()
|
|||
int i = 0;
|
||||
while (host_entry->h_addr_list[i] != 0)
|
||||
{
|
||||
ip = inet_ntoa(*((struct in_addr*)host_entry->h_addr_list[i]));
|
||||
inet_ntop(AF_INET, host_entry->h_addr_list[i], ip, INET_ADDRSTRLEN);
|
||||
WARN_LOG_FMT(SLIPPI_ONLINE, "[Matchmaking] IP at idx {}: {}", i, ip);
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue