Fix a few gcc 8 / scan-build compiler warnings

This commit is contained in:
ejurgensen
2019-09-22 00:51:17 +02:00
parent cf927e7daa
commit 56d3f42598
3 changed files with 4 additions and 1 deletions

View File

@@ -322,7 +322,8 @@ pict_tmpfile_recreate(struct pipe_metadata *pm, const char *ext)
pict_tmpfile_close(pm);
strcpy(pm->pict_tmpfile_path, PIPE_TMPFILE_TEMPLATE);
strncpy(pm->pict_tmpfile_path + offset, ext, PIPE_TMPFILE_TEMPLATE_EXTLEN);
// Use memcpy instead of strncpy because gcc 8 gives false warnings otherwise
memcpy(pm->pict_tmpfile_path + offset, ext, PIPE_TMPFILE_TEMPLATE_EXTLEN);
pm->pict_tmpfile_fd = mkstemps(pm->pict_tmpfile_path, PIPE_TMPFILE_TEMPLATE_EXTLEN);