extract/ExtBasic.c: Incorrect return-value check for a 'scanf'-like function

Fix code scanning alert no. 138: Incorrect return-value check for a 'scanf'-like function (#22)

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-10-01 12:36:12 -04:00
committed by Tim Edwards
co-authored by Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent 91ec4e4cb8
commit c16c770d7a
+2 -2
View File
@@ -389,7 +389,7 @@ extBasic(def, outFile)
if (propfound)
{
token = strtok(NULL, " ");
if ((token == NULL) || !sscanf(token, "%d", &llx))
if ((token == NULL) || (sscanf(token, "%d", &llx) != 1))
propfound = FALSE;
else
llx *= ExtCurStyle->exts_unitsPerLambda;
@@ -397,7 +397,7 @@ extBasic(def, outFile)
if (propfound)
{
token = strtok(NULL, " ");
if ((token == NULL) || !sscanf(token, "%d", &lly))
if ((token == NULL) || (sscanf(token, "%d", &lly) != 1))
propfound = FALSE;
else
lly *= ExtCurStyle->exts_unitsPerLambda;