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>
This commit is contained in:
Darryl Miles 2024-09-30 01:50:14 +01:00 committed by Tim Edwards
parent 886a0212e8
commit c89455782b
1 changed files with 1 additions and 1 deletions

View File

@ -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;