From 55de18c6759c0bfd88b28a37619ecda7a148c998 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 27 Apr 2022 21:27:07 +0200 Subject: [PATCH] spm: constify badchars; suggested by cppcheck --- src/util-spm-bs2bm.c | 6 ++++-- src/util-spm-bs2bm.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/util-spm-bs2bm.c b/src/util-spm-bs2bm.c index d6529df85d..85d85dced6 100644 --- a/src/util-spm-bs2bm.c +++ b/src/util-spm-bs2bm.c @@ -90,7 +90,8 @@ void Bs2BmBadcharsNocase(const uint8_t *needle, uint16_t needle_len, uint8_t *ba * * \retval ptr to start of the match; NULL if no match */ -uint8_t * Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, uint8_t badchars[]) +uint8_t *Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, + uint16_t needle_len, const uint8_t badchars[]) { const uint8_t *h, *n; const uint8_t *hmax = haystack + haystack_len; @@ -139,7 +140,8 @@ uint8_t * Bs2Bm(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *n * * \retval ptr to start of the match; NULL if no match */ -uint8_t *Bs2BmNocase(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, uint16_t needle_len, uint8_t badchars[]) +uint8_t *Bs2BmNocase(const uint8_t *haystack, uint32_t haystack_len, const uint8_t *needle, + uint16_t needle_len, const uint8_t badchars[]) { const uint8_t *h, *n; const uint8_t *hmax = haystack + haystack_len; diff --git a/src/util-spm-bs2bm.h b/src/util-spm-bs2bm.h index a71b1282b8..99cd7abfd7 100644 --- a/src/util-spm-bs2bm.h +++ b/src/util-spm-bs2bm.h @@ -31,8 +31,8 @@ void Bs2BmBadchars(const uint8_t *, uint16_t, uint8_t *); void Bs2BmBadcharsNocase(const uint8_t *, uint16_t, uint8_t *); -uint8_t * Bs2Bm(const uint8_t *, uint32_t, const uint8_t *, uint16_t, uint8_t []); -uint8_t *Bs2BmNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t, uint8_t []); +uint8_t *Bs2Bm(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]); +uint8_t *Bs2BmNocase(const uint8_t *, uint32_t, const uint8_t *, uint16_t, const uint8_t[]); #endif /* __UTIL_SPM_BS2BM__ */