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>
This commit is contained in:
Thomas Arp
2026-04-21 23:14:48 +02:00
committed by GitHub
parent b9f49478a3
commit a465860553

View File

@@ -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);
}