Ensure NULL terminator for VS2005 and below

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

View File

@ -81,6 +81,7 @@ int inet_pton(int af, const char *src, void *dst)
#else #else
char temp[MAX_ADDRSTRLEN]; char temp[MAX_ADDRSTRLEN];
strncpy(temp, src, sizeof(temp)); strncpy(temp, src, sizeof(temp));
temp[MAX_ADDRSTRLEN-1] = '\0';
#endif #endif