From c89455782b4aac9acfb7b078abe65d3760828b0f Mon Sep 17 00:00:00 2001 From: Darryl Miles Date: Mon, 30 Sep 2024 01:50:14 +0100 Subject: [PATCH] cmwind/CMWcmmnds.c: Incorrect return-value check for a 'scanf'-like function Fix code scanning alert no. 134: Incorrect return-value check for a 'scanf'-like function (#13) * Create codeql.yml * Fix code scanning alert no. 134: Incorrect return-value check for a 'scanf'-like function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- cmwind/CMWcmmnds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmwind/CMWcmmnds.c b/cmwind/CMWcmmnds.c index 3cf3404e..b5aaf2dc 100644 --- a/cmwind/CMWcmmnds.c +++ b/cmwind/CMWcmmnds.c @@ -372,7 +372,7 @@ cmwColor(w, cmd) } else if (cmd->tx_argc == 2) { - if (sscanf(cmd->tx_argv[1], "%i", &color) == 0) + if (sscanf(cmd->tx_argv[1], "%i", &color) != 1) { /* Invalid color---allow keywords "next" and "last" */ crec = (CMWclientRec *) w->w_clientData;