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:
parent
91ec4e4cb8
commit
c16c770d7a
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue