diff options
author | Jack Lloyd <[email protected]> | 2017-10-12 11:53:32 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-10-12 11:53:32 -0400 |
commit | 55f12c897a71c8636df8bc019e09108212048722 (patch) | |
tree | 96363b551751a1c4f1c0cc902c243b33fe65f8ea /src/lib/utils/parsing.cpp | |
parent | 39d9e995f49c92d6737d5e641ca306be174a271f (diff) |
Avoid std::count to skip a signed overflow warning
Couldn't figure out a way to silence this otherwise.
Deprecate replace_char, erase_chars, replace_chars
Diffstat (limited to 'src/lib/utils/parsing.cpp')
-rw-r--r-- | src/lib/utils/parsing.cpp | 10 |
1 files changed, 8 insertions, 2 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; } |