mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-22 08:00:27 +00:00
Fix build errors and warnings on Windows
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
|
||||
void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
||||
{
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
|
||||
if (addr->ss_family == AF_INET6) {
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)addr;
|
||||
inet_ntop(addr->ss_family, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
@@ -13,7 +14,7 @@ void addrToUrlSafeString(struct sockaddr_storage *addr, char* string)
|
||||
}
|
||||
else {
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *)addr;
|
||||
char *addrstr = inet_ntoa(sin->sin_addr);
|
||||
inet_ntop(addr->ss_family, &sin->sin_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
// IPv4 addresses are returned without changes
|
||||
sprintf(string, "%s", addrstr);
|
||||
|
||||
Reference in New Issue
Block a user