aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/gamedb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 61d66db..0d65328 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -2000,8 +2000,16 @@ pjournal(int p, int p1, char *fname)
pprintf(p, " White Rating Black Rating "
"Type ECO End Result\n");
+ _Static_assert(ARRAY_SIZE(WhiteName) > 19, "'WhiteName' too small");
+ _Static_assert(ARRAY_SIZE(BlackName) > 19, "'BlackName' too small");
+
+ _Static_assert(ARRAY_SIZE(type) > 99, "'type' too small");
+ _Static_assert(ARRAY_SIZE(eco) > 99, "'eco' too small");
+ _Static_assert(ARRAY_SIZE(ending) > 99, "'ending' too small");
+ _Static_assert(ARRAY_SIZE(result) > 99, "'result' too small");
+
while (!feof(fp)) {
- if (fscanf(fp, "%c %s %d %s %d %s %d %d %s %s %s\n",
+ if (fscanf(fp, "%c %19s %d %19s %d %99s %d %d %99s %99s %99s\n",
&count,
WhiteName, &WhiteRating,
BlackName, &BlackRating,