Fix for gcc 8.2 warnings.

Replace strncat with memcpy to placate gcc 8.2.
Also fix issue in tempfileplus.

Issue #192.
This commit is contained in:
John McNamara 2018-08-22 20:52:12 +01:00
parent d4819bc3a3
commit 4310da6075
2 changed files with 8 additions and 8 deletions

View file

@ -169,7 +169,7 @@ static char *getenv_save(const char *varname, char *buf, size_t bufsize)
buf[0] = '\0';
if (ptr)
{
strncpy(buf, ptr, bufsize);
strncpy(buf, ptr, bufsize-1);
buf[bufsize-1] = '\0';
return buf;
}