commit 4041045: [Minor] Try to be more compatible

Vsevolod Stakhov vsevolod at rspamd.com
Sun Jul 2 16:42:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-07-02 17:39:07 +0100
URL: https://github.com/rspamd/rspamd/commit/4041045abc00aa8f8c0ae211b0bf1648ce44029d (HEAD -> master)

[Minor] Try to be more compatible

---
 src/libutil/cxx/util.hxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libutil/cxx/util.hxx b/src/libutil/cxx/util.hxx
index dd8ef0ee6..df8d99b6c 100644
--- a/src/libutil/cxx/util.hxx
+++ b/src/libutil/cxx/util.hxx
@@ -101,7 +101,7 @@ inline auto string_split_on(const S &input, std::string_view::value_type chr) ->
 	auto pos = std::find(std::begin(input), std::end(input), chr);
 
 	if (pos != input.end()) {
-		auto first = std::string_view{std::begin(input), pos};
+		auto first = std::string_view{std::begin(input), static_cast<std::size_t>(std::distance(std::begin(input), pos))};
 		while (*pos == chr && pos != input.end()) {
 			++pos;
 		}


More information about the Commits mailing list