cppcheck fixes const

This commit is contained in:
iceman1001 committed 2022-01-07 19:13:24 +01:00
1 parent 0d8971916f
commit a8ccba77d6
7 files changed
+35 -34

No files matched your search

+5 -7
View File
@@ -1263,20 +1263,18 @@ int loadFileJSONroot(const char *preferredName, void **proot, bool verbose) {
if (root == NULL) {
PrintAndLogEx(ERR, "ERROR: json " _YELLOW_("%s") " error on line %d: %s", preferredName, error.line, error.text);
retval = PM3_ESOFT;
goto out;
}
if (!json_is_object(root)) {
if (json_is_object(root) == false) {
PrintAndLogEx(ERR, "ERROR: Invalid json " _YELLOW_("%s") " format. root must be an object.", preferredName);
retval = PM3_ESOFT;
goto out;
}
*proot = root;
return PM3_SUCCESS;
if (retval == PM3_ESOFT)
json_decref(root);
else
*proot = root;
out:
json_decref(root);
return retval;
}