Cygwin: avoid GCC 8.3 errors with -Werror=stringop-truncation

This commit is contained in:
Ken Brown
2019-07-15 15:02:00 -04:00
parent f0cf44dc7d
commit b66dddb56d
3 changed files with 5 additions and 5 deletions

View File

@@ -644,7 +644,7 @@ _addenv (const char *name, const char *value, int overwrite)
return -1; /* Oops. No more memory. */
/* Put name '=' value into current slot. */
strncpy (envhere, name, namelen);
memcpy (envhere, name, namelen);
envhere[namelen] = '=';
strcpy (envhere + namelen + 1, value);
}