aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gamedb.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/gamedb.c')
-rw-r--r--FICS/gamedb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index ad7ef78..3a5c50c 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1769,11 +1769,10 @@ write_g_out(int g, char *file, int maxlines, int isDraw, char *EndSymbol,
type[3] = '\0';
- fp = fopen(file, "r");
-
- if (fp) {
- while (!feof(fp))
- fgets(tmp, 1024, fp);
+ if ((fp = fopen(file, "r")) != NULL) {
+ while (fgets(tmp, sizeof tmp, fp) != NULL) {
+ /* null */;
+ }
if (sscanf(ptmp, "%d", &count) != 1)
warnx("%s: failed to read 'count'", __func__);
fclose(fp);