From 57abee2c47e2ea090445b8500dc8fe8c33efbf95 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Tue, 19 Nov 2024 22:40:30 +0100 Subject: Added static assertion --- FICS/variable.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FICS') diff --git a/FICS/variable.c b/FICS/variable.c index c01e177..f9b0c3a 100644 --- a/FICS/variable.c +++ b/FICS/variable.c @@ -476,6 +476,8 @@ Language(unsigned int i) "Danish" }; + _Static_assert(ARRAY_SIZE(Lang) == 4, "Unexpected array size"); + if (i >= ARRAY_SIZE(Lang)) { warnx("%s: invalid arg %u (too large)", __func__, i); return Lang[0]; -- cgit v1.2.3