diff --git a/headers/cpp/std/bastring.h b/headers/cpp/std/bastring.h index ce57ea3414b..59eceab5a1a 100644 --- a/headers/cpp/std/bastring.h +++ b/headers/cpp/std/bastring.h @@ -420,7 +420,7 @@ class basic_string int compare (size_type pos, size_type n, const charT* s) const { return compare(s, pos, n); } int compare (size_type pos, size_type n, const charT* s, size_type n2) const - { return compare(s, pos, std::min(n, n2)); } + { if (n > n2) n = n2; return compare(s, pos, n); } int compare (const charT* s, size_type pos = 0) const { return compare (s, pos, traits::length (s)); }