From a465860553d47a7b07f76f3224ec25012c96345d Mon Sep 17 00:00:00 2001 From: Thomas Arp <357770+welcor@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:14:48 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 70: Incorrect return-value check for a 'scanf'-like function (#169) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/shop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shop.c b/src/shop.c index 8878bc2..645cbfa 100644 --- a/src/shop.c +++ b/src/shop.c @@ -1052,7 +1052,7 @@ static void read_line(FILE *shop_f, const char *string, void *data) { char buf[READ_SIZE]; - if (!get_line(shop_f, buf) || !sscanf(buf, string, data)) { + if (!get_line(shop_f, buf) || sscanf(buf, string, data) != 1) { log("SYSERR: Error in shop #%d, near '%s' with '%s'", SHOP_NUM(top_shop), buf, string); exit(1); }