From: Vsevolod Stakhov Date: Sat, 22 May 2021 12:23:13 +0000 (+0100) Subject: [Minor] Const-ify trim function as it does not change anything in fact X-Git-Tag: 3.0~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fe34b16f2f1d29359d93458ac5f8d9cf6ff38c3;p=thirdparty%2Frspamd.git [Minor] Const-ify trim function as it does not change anything in fact --- diff --git a/src/libutil/cxx/utf8_util.cxx b/src/libutil/cxx/utf8_util.cxx index cf71ae2ae8..e42ef917fa 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 21add9baed..242e03f00d 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,