]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
int_array: Mark the array parameter to int_array_includes() const
authorJouni Malinen <quic_jouni@quicinc.com>
Sat, 22 Mar 2025 08:50:09 +0000 (10:50 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Mar 2025 08:51:04 +0000 (10:51 +0200)
The int_array is not modified when checking whether it contains a
specific entry.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/utils/common.c
src/utils/common.h

index d62dec721b5646d6d1929ee691802c042f1b5d62..d5e51a7924894c8af502336f225e422ebe4d0f6e 100644 (file)
@@ -990,7 +990,7 @@ void int_array_add_unique(int **res, int a)
 }
 
 
-bool int_array_includes(int *arr, int val)
+bool int_array_includes(const int *arr, int val)
 {
        int i;
 
index 1dc2ea5aa7ea038cb3da32daf0f600d3ed8d9c90..f1c46599e759dfdc5d7b67bb7724cef6739f5421 100644 (file)
@@ -594,7 +594,7 @@ size_t int_array_len(const int *a);
 void int_array_concat(int **res, const int *a);
 void int_array_sort_unique(int *a);
 void int_array_add_unique(int **res, int a);
-bool int_array_includes(int *arr, int val);
+bool int_array_includes(const int *arr, int val);
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))