fix gcc10 warnings
gcc10 doesn't like its own strncpy
This commit is contained in:
parent
e0ec32f1e3
commit
fed1c62571
@ -788,7 +788,7 @@ static char* mallocAndJoin2Dir(const char *dir1, const char *dir2)
|
||||
outDirBuffer = (char *) malloc(dir1Size + dir2Size + 2);
|
||||
CONTROL(outDirBuffer != NULL);
|
||||
|
||||
strncpy(outDirBuffer, dir1, dir1Size);
|
||||
memcpy(outDirBuffer, dir1, dir1Size);
|
||||
outDirBuffer[dir1Size] = '\0';
|
||||
|
||||
if (dir2[0] == '.')
|
||||
@ -800,7 +800,7 @@ static char* mallocAndJoin2Dir(const char *dir1, const char *dir2)
|
||||
*buffer = PATH_SEP;
|
||||
buffer++;
|
||||
}
|
||||
strncpy(buffer, dir2, dir2Size);
|
||||
memcpy(buffer, dir2, dir2Size);
|
||||
buffer[dir2Size] = '\0';
|
||||
|
||||
return outDirBuffer;
|
||||
|
Loading…
Reference in New Issue
Block a user