From 2c73337bde37e2271534b621d454c85e2fe6e364 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 28 Jan 2021 14:32:57 +0100 Subject: [PATCH] cppchecker ,, silence a warning --- client/src/preferences.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/preferences.c b/client/src/preferences.c index b133dd428..92a91e54a 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -834,7 +834,7 @@ static int setCmdSavePaths(const char *Cmd) { CLIParserFree(ctx); if (deflen == 0 && dulen == 0 && tlen == 0) { - PrintAndLogEx(FAILED, "Must give atleast one path"); + PrintAndLogEx(FAILED, "Must give at least one path"); return PM3_EINVARG; } @@ -853,6 +853,11 @@ static int setCmdSavePaths(const char *Cmd) { path = trace_path; } + if (path == NULL) { + PrintAndLogEx(FAILED, "Must give at least one path"); + return PM3_EINVARG; + } + // remove trailing slash. size_t nplen = strlen(path); if ((path[nplen - 1] == '/') || (path[nplen - 1] == '\\')) {