Ensure NULL terminator for VS2005 and below
parent
ecb62a9311
commit
1f779dec2a
|
|
@ -81,9 +81,9 @@ int inet_pton(int af, const char *src, void *dst)
|
|||
#else
|
||||
char temp[MAX_ADDRSTRLEN];
|
||||
strncpy(temp, src, sizeof(temp));
|
||||
temp[MAX_ADDRSTRLEN-1] = '0';
|
||||
#endif
|
||||
|
||||
|
||||
int size = sizeof(ss);
|
||||
if (WSAStringToAddress(temp, af, NULL, (struct sockaddr *)&ss, &size) == 0) {
|
||||
switch (af) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue