From b463f2ab5ac15438d25bff327249e622a0fb19cc Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 9 Oct 2019 10:48:20 +0200 Subject: [PATCH] coverity 226340, make sure its not null --- client/fileutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/fileutils.c b/client/fileutils.c index 57aa939a7..294d92f15 100644 --- a/client/fileutils.c +++ b/client/fileutils.c @@ -910,7 +910,7 @@ static int filelist(const char *path, const char *ext, bool last, bool tentative PrintAndLogEx(NORMAL, "%s── %s", last ? "└" : "├", path); for (uint16_t i = 0; i < n; i++) { - if (((ext == NULL) && (namelist[i]->d_name[0] != '.')) || (str_endswith(namelist[i]->d_name, ext))) { + if (((ext == NULL) && (namelist[i]->d_name[0] != '.')) || ((ext != NULL) && (str_endswith(namelist[i]->d_name, ext)))) { PrintAndLogEx(NORMAL, "%s   %s── %-21s", last ? " " : "│", i == n - 1 ? "└" : "├", namelist[i]->d_name); } free(namelist[i]);