From 8ae15965ea723839e4a1d9e7aa9b7ec3960c5998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 18 Apr 2023 22:50:30 +0200 Subject: [PATCH] Fixes #242 ("Issue with string::rfind") --- include/boost/container/string.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index 4474ed4..b43d9f8 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -2458,7 +2458,7 @@ class basic_string else if (n == 0) return dtl::min_value(len, pos); else { - const const_iterator last = begin() + difference_type(dtl::min_value(len - n, pos + n)); + const const_iterator last = begin() + difference_type(dtl::min_value(len - n, pos) + n); const const_iterator result = boost::container::find_end (begin(), last, s, s + difference_type(n), Eq_traits()); return result != last ? size_type(result - begin()) : npos;