aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/gamedb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 99600f8..fe55052 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1262,7 +1262,11 @@ ReadV1GameFmt(game *g, FILE *fp, const char *file, int version)
} else
g->timeOfStart = lval;
- fscanf(fp, "%d %d", &g->wTime, &g->bTime);
+ if (fscanf(fp, "%d %d", &g->wTime, &g->bTime) != 2) {
+ warnx("%s: %s: failed to get 'wTime' and 'bTime'", __func__,
+ file);
+ return -1;
+ }
if (version > 1)
fscanf(fp, "%d %d", &g->result, &g->winner);