mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 20:26:21 +00:00
src/plugins/python_api.c: drop redundant NULL pointer check
gcc-12 detects redundant check against array of arrays as:
src/plugins/python_api.c: In function ‘python_api_register_command’:
src/plugins/python_api.c:199:31: error: the comparison will always evaluate as ‘true’ for the address of ‘c_arguments’ will never be NULL [-Werror=address]
199 | while (c_arguments[i] != NULL && c_arguments[i][0] != NULL) {
| ^~
src/plugins/python_api.c:161:15: note: ‘c_arguments’ declared here
161 | char* c_arguments[args_len == 0 ? 0 : args_len + 1][2];
| ^~~~~~~~~~~
This commit is contained in:
@@ -196,7 +196,7 @@ python_api_register_command(PyObject* self, PyObject* args)
|
||||
free(c_synopsis[i++]);
|
||||
}
|
||||
i = 0;
|
||||
while (c_arguments[i] != NULL && c_arguments[i][0] != NULL) {
|
||||
while (c_arguments[i][0] != NULL) {
|
||||
free(c_arguments[i][0]);
|
||||
free(c_arguments[i][1]);
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user