aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-07-28 16:39:17 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2025-07-28 16:39:17 +0200
commitbd28e1cc0bb5f1ff886e0cb8bbd826b2e80f4108 (patch)
tree256337c92892f9bd510a7c2a9072094d879b09b4 /FICS
parent8c4d29e62e3c4ebc2e5dcd125d70e51dd704dbee (diff)
Fixed missing return-value check for a 'scanf'-like function
Diffstat (limited to 'FICS')
-rw-r--r--FICS/ratings.c6
1 files changed, 3 insertions, 3 deletions
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;
}