1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

src/plugins/callbacks.c: drop redundant NULL pointer check

gcc-12 detects redundant check against array of arrays as:

    src/plugins/callbacks.c: In function ‘_free_command_help’:
    src/plugins/callbacks.c:85:26: error: the comparison will always evaluate as ‘true’ for the address of ‘args’ will never be NULL [-Werror=address]
       85 |     while (help->args[i] != NULL && help->args[i][0] != NULL) {
          |                          ^~
    In file included from ./src/ui/ui.h:44,
                     from ./src/command/cmd_defs.h:42,
                     from src/plugins/callbacks.c:41:
    ./src/command/cmd_funcs.h:48:12: note: ‘args’ declared here
       48 |     gchar* args[128][2];
          |            ^~~~
This commit is contained in:
Sergei Trofimovich 2021-11-18 22:27:20 +00:00
parent 9a9122c148
commit 753d9dbbdb

View File

@ -82,7 +82,7 @@ _free_command_help(CommandHelp* help)
free(help->desc); free(help->desc);
i = 0; i = 0;
while (help->args[i] != NULL && help->args[i][0] != NULL) { while (help->args[i][0] != NULL) {
free(help->args[i][0]); free(help->args[i][0]);
free(help->args[i][1]); free(help->args[i][1]);
i++; i++;