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

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

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:59 +01:00 committed by Tim Edwards
parent c16c770d7a
commit 0619cf4291
1 changed files with 2 additions and 2 deletions

View File

@ -405,7 +405,7 @@ extBasic(def, outFile)
if (propfound)
{
token = strtok(NULL, " ");
if ((token == NULL) || !sscanf(token, "%d", &urx))
if ((token == NULL) || (sscanf(token, "%d", &urx) != 1))
propfound = FALSE;
else
urx *= ExtCurStyle->exts_unitsPerLambda;
@ -414,7 +414,7 @@ extBasic(def, outFile)
if (propfound)
{
token = strtok(NULL, " ");
if ((token == NULL) || !sscanf(token, "%d", &ury))
if ((token == NULL) || (sscanf(token, "%d", &ury) != 1))
propfound = FALSE;
else
ury *= ExtCurStyle->exts_unitsPerLambda;