]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Try to be more compatible
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 2 Jul 2023 16:39:07 +0000 (17:39 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 2 Jul 2023 16:39:07 +0000 (17:39 +0100)
src/libutil/cxx/util.hxx

index dd8ef0ee6527021de6e38d47dd1c390ddbe9f44d..df8d99b6c606d59c36ed8d19f031eade54ee2704 100644 (file)
@@ -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;
                }