]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Const-ify trim function as it does not change anything in fact
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 May 2021 12:23:13 +0000 (13:23 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 May 2021 12:23:13 +0000 (13:23 +0100)
src/libutil/cxx/utf8_util.cxx
src/libutil/cxx/utf8_util.h

index cf71ae2ae813a4d32aed4f6685e8de6c3828675d..e42ef917fa300338d0afe27fbf05bf4e0cae519e 100644 (file)
 #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
 #include "doctest/doctest.h"
 
-char *
-rspamd_string_unicode_trim_inplace (char *str, size_t *len)
+const char *
+rspamd_string_unicode_trim_inplace (const char *str, size_t *len)
 {
-       auto *p = str, *end = str + *len;
+       const auto *p = str, *end = str + *len;
        auto i = 0;
 
        while (i < *len) {
index 21add9baedfe7085c9d720b42288ffcf29274149..242e03f00d6ee374f3a63541c0d1eeda203cfdd1 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
  * @param len length
  * @return new length of the string trimmed
  */
-char* rspamd_string_unicode_trim_inplace (char *str, size_t *len);
+const char* rspamd_string_unicode_trim_inplace (const char *str, size_t *len);
 
 enum rspamd_normalise_result {
        RSPAMD_UNICODE_NORM_NORMAL = 0,