mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 06:07:34 +02:00
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:
committed by
Tim Edwards
co-authored by
Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent
886a0212e8
commit
c89455782b
+1
-1
@@ -372,7 +372,7 @@ cmwColor(w, cmd)
|
|||||||
}
|
}
|
||||||
else if (cmd->tx_argc == 2)
|
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" */
|
/* Invalid color---allow keywords "next" and "last" */
|
||||||
crec = (CMWclientRec *) w->w_clientData;
|
crec = (CMWclientRec *) w->w_clientData;
|
||||||
|
|||||||
Reference in New Issue
Block a user