aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/gamedb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 394745c..2c4511b 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -899,7 +899,8 @@ ReadMove(FILE *fp, move_t *m)
{
char line[MAX_GLINE_SIZE] = { '\0' };
- fgets(line, sizeof line, fp);
+ if (fgets(line, sizeof line, fp) == NULL)
+ return -1;
if (sscanf(line, "%d %d %d %d %d %d %d %d %d \"%[^\"]\" \"%[^\"]\" "
"%u %u\n",