lib: add IWINFO_OPMODE_COUNT and use it for IWINFO_OPMODE_NAMES
authorAndre Heider <a.heider@gmail.com>
Mon, 21 Nov 2022 09:11:13 +0000 (10:11 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 15 Dec 2022 22:52:27 +0000 (23:52 +0100)
Match the other string arrays, which allows us to consistently loop over them.

Signed-off-by: Andre Heider <a.heider@gmail.com>
include/iwinfo.h
iwinfo_lib.c

index 90e59067cdf1495b689fd432831f71c27a7ebc36..71fadabb077b296647a95eab772c8fb50b171bf8 100644 (file)
@@ -84,9 +84,11 @@ enum iwinfo_opmode {
        IWINFO_OPMODE_MESHPOINT  = 7,
        IWINFO_OPMODE_P2P_CLIENT = 8,
        IWINFO_OPMODE_P2P_GO     = 9,
+
+       IWINFO_OPMODE_COUNT      = 10,
 };
 
-extern const char * const IWINFO_OPMODE_NAMES[];
+extern const char * const IWINFO_OPMODE_NAMES[IWINFO_OPMODE_COUNT];
 
 
 enum iwinfo_htmode {
index 93d4b2519c340189762e4f9a090471f0a8c006a9..353ecb8487669ab0e944702649f4cf52d43a6ade 100644 (file)
@@ -49,7 +49,7 @@ const char * const IWINFO_AUTH_NAMES[IWINFO_AUTH_COUNT] = {
        "SHARED",
 };
 
-const char * const IWINFO_OPMODE_NAMES[] = {
+const char * const IWINFO_OPMODE_NAMES[IWINFO_OPMODE_COUNT] = {
        "Unknown",
        "Master",
        "Ad-Hoc",