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);

View File

@ -391,6 +391,7 @@ mfi_id_find(const char *path)
{
if (qp.results == 1)
{
free(winner); // This is just here to keep scan-build happy
winner = strdup(dbpath);
break;
}

View File

@ -159,6 +159,7 @@ process_regular_file(int pl_id, char *path)
{
if (qp.results == 1)
{
free(winner); // This is just here to keep scan-build happy
winner = strdup(dbpath);
break;
}