Ensure NULL terminator for VS2005 and below

pull/326/head
Jeffrey Walton 2016-10-10 15:55:15 -04:00
parent ecb62a9311
commit 1f779dec2a
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 1 additions and 1 deletions

View File

@ -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) {