aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gamedb.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/gamedb.c')
-rw-r--r--FICS/gamedb.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 064a18a..394745c 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1271,10 +1271,15 @@ ReadGameAttrs(FILE *fp, char *fname, int g)
int len;
int version = 0;
- fgets(line, sizeof line, fp);
+ if (fgets(line, sizeof line, fp) == NULL) {
+ warnx("%s: fgets error", __func__);
+ return -1;
+ }
- if (line[0] == 'v')
- sscanf(line, "%*c %d", &version);
+ if (line[0] == 'v') {
+ if (sscanf(line, "%*c %d", &version) != 1)
+ warn("%s: failed to get version", __func__);
+ }
if (version > 0)
ReadV1GameFmt(&garray[g], fp, fname, version);