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-09-30 04:54:46 +01:00 committed by Tim Edwards
parent 91ec4e4cb8
commit c16c770d7a
1 changed files with 2 additions and 2 deletions

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;