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-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 c16c770d7a
commit 0619cf4291
+2 -2
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;