summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2023-11-15 14:38:49 +0100
committerLuke from DC <[email protected]>2023-11-21 20:19:58 +0000
commitf9fb27ba92e61a16a81285aedcfab5d28bd5519e (patch)
tree4f056fc37250ee01bd7fca2f4ee598bdd40360cf
parent074e5d0136beb84dec62e0a40209c42dab793d87 (diff)
downloadmate-panel-f9fb27ba92e61a16a81285aedcfab5d28bd5519e.tar.bz2
mate-panel-f9fb27ba92e61a16a81285aedcfab5d28bd5519e.tar.xz
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)) > ^
-rw-r--r--mate-panel/panel-run-dialog.c2
1 files changed, 1 insertions, 1 deletions
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);