diff options
author | Tim Taubert <ttaubert@mozilla.com> | 2017-05-31 09:44:40 +0200 |
---|---|---|
committer | Tim Taubert <ttaubert@mozilla.com> | 2017-05-31 09:44:40 +0200 |
commit | ced5d947dc784954bb8ef481dedc84b010fcfe2c (patch) | |
tree | 9012e3320a81d90739f83ce4a5b5a4772fe6fd63 /gtests/freebl_gtest | |
parent | 12eafd286b2ada9d401cb6c79d5771a46b98a42e (diff) | |
download | nss-hg-ced5d947dc784954bb8ef481dedc84b010fcfe2c.tar.gz |
Bug 1355041 - Add Windows gyp builds to TC r=franziskus
Diffstat (limited to 'gtests/freebl_gtest')
-rw-r--r-- | gtests/freebl_gtest/prng_kat_unittest.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtests/freebl_gtest/prng_kat_unittest.cc b/gtests/freebl_gtest/prng_kat_unittest.cc index 6e3c9320f..7bc9beea3 100644 --- a/gtests/freebl_gtest/prng_kat_unittest.cc +++ b/gtests/freebl_gtest/prng_kat_unittest.cc @@ -34,7 +34,7 @@ bool contains(std::string& s, const char* to_find) { } std::string trim(std::string str) { - std::string whitespace = " \t"; + std::string whitespace = " \t\r\n"; const auto strBegin = str.find_first_not_of(whitespace); if (strBegin == std::string::npos) { return ""; @@ -46,7 +46,8 @@ std::string trim(std::string str) { std::vector<uint8_t> hex_string_to_bytes(std::string s) { std::vector<uint8_t> bytes; - for (size_t i = 0; i < s.length() - 1; i += 2) { + assert(s.length() % 2 == 0); + for (size_t i = 0; i < s.length(); i += 2) { bytes.push_back(std::stoul(s.substr(i, 2), nullptr, 16)); } return bytes; |