From 9887ec2ab393b73442d2f7df4e4c39c9f637cf56 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 18 Dec 2022 22:40:04 +0200 Subject: [PATCH 45/45] rulesave: Fix clang analyzer warning about strcmp(NULL, ...) See osdn #46292 Signed-off-by: Marko Lindqvist --- tools/ruleutil/rulesave.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index b1bde303ae..9c68cebbfd 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -841,6 +841,12 @@ static bool save_action_ui_name(struct section_file *sfile, { const char *ui_name = action_by_number(act)->ui_name; + if (ui_name == NULL) { + fc_assert(ui_name != NULL); + + return FALSE; + } + if (strcmp(ui_name, action_ui_name_default(act))) { secfile_insert_str(sfile, ui_name, "actions.%s", entry_name); -- 2.35.1