Index: uspace/lib/cpp/include/impl/string.hpp
===================================================================
--- uspace/lib/cpp/include/impl/string.hpp	(revision 6c089a909193b6401c87f8f44b601583ce81b926)
+++ uspace/lib/cpp/include/impl/string.hpp	(revision a6ca1bc63d024ea03c46f7322c9aa5555630a775)
@@ -1019,5 +1019,5 @@
             size_type find(const value_type* str, size_type pos, size_type len) const noexcept
             {
-                if (empty() || len == 0 || len - pos > size())
+                if (empty() || len == 0 || len + pos > size())
                     return npos;
 
@@ -1060,5 +1060,5 @@
             size_type rfind(const value_type* str, size_type pos, size_type len) const noexcept
             {
-                if (empty() || len == 0 || len - pos > size())
+                if (empty() || len == 0 || len + pos > size())
                     return npos;
 
@@ -1085,5 +1085,5 @@
                     return npos;
 
-                for (size_type i = min(pos, size_ - 1) + 1; i > 0; --i)
+                for (size_type i = min(pos + 1, size_ - 1) + 1; i > 0; --i)
                 {
                     if (traits_type::eq(c, data_[i - 1]))
@@ -1101,5 +1101,5 @@
             size_type find_first_of(const value_type* str, size_type pos, size_type len) const noexcept
             {
-                if (empty() || len == 0 || pos + len > size())
+                if (empty() || len == 0 || pos >= size())
                     return npos;
 
@@ -1133,5 +1133,5 @@
             size_type find_last_of(const value_type* str, size_type pos, size_type len) const noexcept
             {
-                if (empty())
+                if (empty() || len == 0)
                     return npos;
 
@@ -1162,5 +1162,5 @@
             size_type find_first_not_of(const value_type* str, size_type pos, size_type len) const noexcept
             {
-                if (empty() || len == 0 || pos + len > size())
+                if (empty() || pos >= size())
                     return npos;
 
@@ -1179,5 +1179,5 @@
             size_type find_first_not_of(const value_type* str, size_type pos = 0) const noexcept
             {
-                return find_first_not_of(str.c_str(), pos, str.size());
+                return find_first_not_of(str, pos, traits_type::length(str));
             }
 
@@ -1208,5 +1208,5 @@
                 for (size_type i = min(pos, size_ - 1) + 1; i > 0; --i)
                 {
-                    if (!is_one_of_(i - 1, str, len))
+                    if (!is_any_of_(i - 1, str, len))
                         return i - 1;
                 }
@@ -1387,10 +1387,9 @@
             }
 
-            bool is_one_of_(size_type idx, const basic_string& str) const
-            {
-                auto cstr = str.c_str();
-                for (size_type i = 0; i < str.size(); ++i)
-                {
-                    if (traits_type::eq(data_[idx], cstr[i]))
+            bool is_any_of_(size_type idx, const value_type* str, size_type len) const
+            {
+                for (size_type i = 0; i < len; ++i)
+                {
+                    if (traits_type::eq(data_[idx], str[i]))
                         return true;
                 }
