From 0619cf4291025b5ba111dfd1cc3b00483e4d542c Mon Sep 17 00:00:00 2001 From: Darryl Miles Date: Mon, 30 Sep 2024 04:54:59 +0100 Subject: [PATCH] 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> --- extract/ExtBasic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index e436368a..14bc7eed 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -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;