From bd28e1cc0bb5f1ff886e0cb8bbd826b2e80f4108 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 28 Jul 2025 16:39:17 +0200 Subject: Fixed missing return-value check for a 'scanf'-like function --- FICS/ratings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'FICS/ratings.c') diff --git a/FICS/ratings.c b/FICS/ratings.c index e445c51..1161c5c 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -1567,7 +1567,8 @@ GetRank(FILE *fp, char *target, int countComp) char line[MAX_RANK_LINE] = { '\0' }; char login[MAX_LOGIN_NAME] = { '\0' }; int count = 0; - int nGames, is_computer; + int is_computer = 0; + int nGames = 0; int playerFound = 0; while (fgets(line, sizeof line, fp) != NULL && @@ -1575,8 +1576,7 @@ GetRank(FILE *fp, char *target, int countComp) _Static_assert(ARRAY_SIZE(login) > 19, "'login' too small"); if (sscanf(line, "%19s %*d %d %d", login, &nGames, &is_computer) - != 1) { -// warnx("%s: sscanf() error", __func__); + < 3) { continue; } -- cgit v1.2.3