mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 06:07:34 +02:00
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:
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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user