mirror of
https://github.com/tbamud/tbamud.git
synced 2026-04-30 04:41:51 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user