From 452ea290d35f7f264d8636e738cd9c9e9437a916 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 24 Nov 2024 12:37:59 +0100 Subject: Changed RemHist() --- FICS/gamedb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/FICS/gamedb.c b/FICS/gamedb.c index 22e942b..e436cab 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -1669,15 +1669,14 @@ RemHist(char *who) if ((fp = fopen(fName, "r")) != NULL) { long int iter_no = 0; - while (!feof(fp)) { - // XXX: end the format string with a newline? + while (!feof(fp) && !ferror(fp)) { const int ret = fscanf(fp, "%*d %*c %*d %*c %*d %19s " - "%*s %*d %*d %*d %*d %*s %*s %ld", Opp, &When); + "%*s %*d %*d %*d %*d %*s %*s %ld\n", Opp, &When); if (ret != 2) { warnx("%s: fscanf() error (%s:%ld)", __func__, fName, iter_no); - iter_no++; - continue; +// iter_no++; + break; } stolower(Opp); -- cgit v1.2.3