aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-11-19 22:40:30 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-11-19 22:40:30 +0100
commit57abee2c47e2ea090445b8500dc8fe8c33efbf95 (patch)
tree8090fafde4b430306f9a306a6f8f1d6ccf1c8588
parent3b03270d2ca54e96b03acac99ffd9449ec96e8a2 (diff)
Added static assertion
-rw-r--r--FICS/variable.c2
1 files changed, 2 insertions, 0 deletions
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];