diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-22 13:23:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-22 13:23:13 +0100 |
commit | 4fe34b16f2f1d29359d93458ac5f8d9cf6ff38c3 (patch) | |
tree | ee0806a85de27c48ec238328c3b185e1c7441c31 /src | |
parent | bafb84fe5aefa9bc0f5d6f1e9e942a86bba472bf (diff) | |
download | rspamd-4fe34b16f2f1d29359d93458ac5f8d9cf6ff38c3.tar.gz rspamd-4fe34b16f2f1d29359d93458ac5f8d9cf6ff38c3.zip |
[Minor] Const-ify trim function as it does not change anything in fact
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/cxx/utf8_util.cxx | 6 | ||||
-rw-r--r-- | src/libutil/cxx/utf8_util.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/cxx/utf8_util.cxx b/src/libutil/cxx/utf8_util.cxx index cf71ae2ae..e42ef917f 100644 --- a/src/libutil/cxx/utf8_util.cxx +++ b/src/libutil/cxx/utf8_util.cxx @@ -30,10 +30,10 @@ #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) { diff --git a/src/libutil/cxx/utf8_util.h b/src/libutil/cxx/utf8_util.h index 21add9bae..242e03f00 100644 --- a/src/libutil/cxx/utf8_util.h +++ b/src/libutil/cxx/utf8_util.h @@ -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, |