aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/gamedb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index ee71af4..3b3c3aa 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1542,8 +1542,13 @@ OldestHistGame(char *login)
}
if (fp != NULL) {
- fscanf(fp, "%*d %*c %*d %*c %*d %*s %*s %*d %*d %*d %*d %*s "
- "%*s %ld", &when);
+ if (fscanf(fp, "%*d %*c %*d %*c %*d %*s %*s %*d %*d %*d %*d "
+ "%*s %*s %ld", &when) != 1) {
+ warnx("%s: %s: failed to read 'when'", __func__,
+ &pFile[0]);
+ fclose(fp);
+ return 0L;
+ }
fclose(fp);
return when;
} else