aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-08-03 22:13:28 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-08-03 22:13:28 +0200
commitf34a709d6be34399080768a95b361a7fb110d7ab (patch)
tree7bf60eb6a2c405c148e365e5081961e28aba83d3
parenta22686dfd2158200e4615d5c630c23567246220b (diff)
Static assertions
-rw-r--r--FICS/gamedb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index d3fff96..5becbd4 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1236,6 +1236,9 @@ ReadV1GameFmt(game *g, FILE *fp, const char *file, int version)
int ret[3];
long int lval;
+ _Static_assert(17 < ARRAY_SIZE(g->white_name), "Unexpected array size");
+ _Static_assert(17 < ARRAY_SIZE(g->black_name), "Unexpected array size");
+
ret[0] = fscanf(fp, "%s %s", g->white_name, g->black_name);
ret[1] = fscanf(fp, "%d %d", &g->white_rating, &g->black_rating);
ret[2] = fscanf(fp, "%d %d %d %d",