diff options
-rw-r--r-- | src/lib/utils/parsing.cpp | 10 | ||||
-rw-r--r-- | src/lib/utils/parsing.h | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/utils/parsing.cpp b/src/lib/utils/parsing.cpp index e0173443f..9517cc673 100644 --- a/src/lib/utils/parsing.cpp +++ b/src/lib/utils/parsing.cpp @@ -13,7 +13,6 @@ #include <botan/loadstor.h> #include <limits> #include <set> -#include <algorithm> namespace Botan { @@ -346,7 +345,14 @@ bool host_wildcard_match(const std::string& issued, const std::string& host) return true; } - if(std::count(issued.begin(), issued.end(), '*') > 1) + size_t stars = 0; + for(char c : issued) + { + if(c == '*') + stars += 1; + } + + if(stars > 1) { return false; } diff --git a/src/lib/utils/parsing.h b/src/lib/utils/parsing.h index dbf5d426a..1cba23bc3 100644 --- a/src/lib/utils/parsing.h +++ b/src/lib/utils/parsing.h @@ -48,7 +48,9 @@ split_on_pred(const std::string& str, /** * Erase characters from a string */ -BOTAN_PUBLIC_API(2,0) std::string erase_chars(const std::string& str, const std::set<char>& chars); +BOTAN_PUBLIC_API(2,0) +BOTAN_DEPRECATED("Unused") +std::string erase_chars(const std::string& str, const std::set<char>& chars); /** * Replace a character in a string @@ -58,6 +60,7 @@ BOTAN_PUBLIC_API(2,0) std::string erase_chars(const std::string& str, const std: * @return str with all instances of from_char replaced by to_char */ BOTAN_PUBLIC_API(2,0) +BOTAN_DEPRECATED("Unused") std::string replace_char(const std::string& str, char from_char, char to_char); @@ -70,6 +73,7 @@ std::string replace_char(const std::string& str, * @return str with all instances of from_chars replaced by to_char */ BOTAN_PUBLIC_API(2,0) +BOTAN_DEPRECATED("Unused") std::string replace_chars(const std::string& str, const std::set<char>& from_chars, char to_char); |