From ec46f558211e0cee8d3704d815bf908db48fff18 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 13 May 2021 21:19:16 +0200 Subject: [PATCH] fix cppchecker, bad boolean compare and unused value --- client/src/cmdhffido.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/cmdhffido.c b/client/src/cmdhffido.c index 80758f309..1c5d7a4fa 100644 --- a/client/src/cmdhffido.c +++ b/client/src/cmdhffido.c @@ -195,7 +195,7 @@ static int CmdHFFidoRegister(const char *cmd) { return PM3_EINVARG; } } - if (cphex & !cpplain) { + if (cphex && cpplain == false) { chlen = sizeof(cdata); CLIGetHexWithReturn(ctx, 7, cdata, &chlen); if (chlen && chlen != 32) { @@ -219,7 +219,7 @@ static int CmdHFFidoRegister(const char *cmd) { return PM3_EINVARG; } } - if (aphex & !applain) { + if (aphex && applain == false) { applen = sizeof(adata); CLIGetHexWithReturn(ctx, 8, adata, &applen); if (applen && applen != 32) { @@ -380,6 +380,7 @@ static int CmdHFFidoRegister(const char *cmd) { //sprintf(filename, "hf-fido2-params"); res = saveFileJSONroot(filename, root, JSON_INDENT(2), verbose); + (void)res; } json_decref(root); return PM3_SUCCESS; @@ -635,6 +636,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) { sprintf(filename, "hf-fido2-params"); res = saveFileJSONroot(filename, root, JSON_INDENT(2), verbose); + (void)res; } json_decref(root); return PM3_ESOFT; @@ -754,6 +756,7 @@ static int CmdHFFido2MakeCredential(const char *cmd) { // new file name.. sprintf(filename, "hf-fido2"); res = saveFileJSONroot(filename, root, JSON_INDENT(2), verbose); + (void)res; json_decref(root); return res; } @@ -873,6 +876,7 @@ static int CmdHFFido2GetAssertion(const char *cmd) { // new file name.. sprintf(filename, "hf-fido2"); res = saveFileJSONroot(filename, root, JSON_INDENT(2), verbose); + (void)res; json_decref(root); return res; }