From 9a4af82f902e0607eb085cd2ef0392389ea0ba8b Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 18 Jul 2024 12:32:14 +0200 Subject: Handle the return of sscanf() --- FICS/gamedb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'FICS') diff --git a/FICS/gamedb.c b/FICS/gamedb.c index 639dd46..8584885 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -1690,7 +1690,8 @@ write_g_out(int g, char *file, int maxlines, int isDraw, char *EndSymbol, if (fp) { while (!feof(fp)) fgets(tmp, 1024, fp); - sscanf(ptmp, "%d", &count); + if (sscanf(ptmp, "%d", &count) != 1) + warnx("%s: failed to read 'count'", __func__); fclose(fp); } -- cgit v1.2.3