fix enet issue #31

easier to fix the library than every use of the functions
This commit is contained in:
ac-stef
2015-09-08 11:51:02 +02:00
parent 2fb111adf4
commit 91753026dc
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -132,6 +132,7 @@ enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameL
char * addr = inet_ntoa (* (struct in_addr *) & address -> host);
if (addr != NULL)
strncpy (name, addr, nameLength);
name[nameLength - 1] = '\0';
else
#endif
return -1;
@@ -165,6 +166,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng
return enet_address_get_host_ip (address, name, nameLength);
strncpy (name, hostEntry -> h_name, nameLength);
name[nameLength - 1] = '\0';
return 0;
}
+2
View File
@@ -80,6 +80,7 @@ enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameL
if (addr == NULL)
return -1;
strncpy (name, addr, nameLength);
name[nameLength - 1] = '\0';
return 0;
}
@@ -96,6 +97,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng
return enet_address_get_host_ip (address, name, nameLength);
strncpy (name, hostEntry -> h_name, nameLength);
name[nameLength - 1] = '\0';
return 0;
}