From f9fb27ba92e61a16a81285aedcfab5d28bd5519e Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Wed, 15 Nov 2023 14:38:49 +0100 Subject: Do not perform useless incoherent NULL check cppcheck tells us that we perform NULL checking inconsistently, and reports a potential NULL dereference. Here however the string cannot be NULL, so just drop the unnecessary check. > mate-panel/panel-run-dialog.c:1663:10: warning: Either the condition '!start' is redundant or there is possible null pointer dereference: start. [nullPointerRedundantCheck] > while (*start != '\0' && g_ascii_isspace (*start)) > ^ > mate-panel/panel-run-dialog.c:1679:6: note: Assuming that condition '!start' is not redundant > if (!start || !start [0]) { > ^ > mate-panel/panel-run-dialog.c:1663:10: note: Null pointer dereference > while (*start != '\0' && g_ascii_isspace (*start)) > ^ --- mate-panel/panel-run-dialog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mate-panel') diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c index a469e6ed..3192239d 100644 --- a/mate-panel/panel-run-dialog.c +++ b/mate-panel/panel-run-dialog.c @@ -1676,7 +1676,7 @@ combobox_changed (GtkComboBox *combobox, } /* desensitize run button if no text entered */ - if (!start || !start [0]) { + if (!start [0]) { g_free (text); gtk_widget_set_sensitive (dialog->run_button, FALSE); -- cgit v1.2.1