aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/hex.cpp
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2020-02-28 17:42:28 -0500
committerLee Clagett <code@leeclagett.com>2020-02-28 17:42:57 -0500
commit533d85d44baa480220ffa5cfbd001f3a4d0e08a1 (patch)
tree871792866eddbd8faa402a86d056114749a79dcb /contrib/epee/src/hex.cpp
parentMerge pull request #6156 (diff)
downloadmonero-533d85d44baa480220ffa5cfbd001f3a4d0e08a1.tar.xz
Fixed string_ref usage bug in epee::from_hex::vector
Diffstat (limited to 'contrib/epee/src/hex.cpp')
-rw-r--r--contrib/epee/src/hex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/epee/src/hex.cpp b/contrib/epee/src/hex.cpp
index 558983f7e..b654a0269 100644
--- a/contrib/epee/src/hex.cpp
+++ b/contrib/epee/src/hex.cpp
@@ -84,7 +84,7 @@ namespace epee
return write_hex(out, src);
}
- std::vector<uint8_t> from_hex::vector(boost::string_ref src)
+ std::vector<uint8_t> from_hex::vector(const boost::string_ref src)
{
// should we include a specific character
auto include = [](char input) {
@@ -104,7 +104,7 @@ namespace epee
result.reserve(count / 2);
// the data to work with (std::string is always null-terminated)
- auto data = src.data();
+ auto data = src.begin();
// convert a single hex character to an unsigned integer
auto char_to_int = [](const char *input) {
@@ -130,9 +130,9 @@ namespace epee
};
// keep going until we reach the end
- while (data[0] != '\0') {
+ while (data != src.end()) {
// skip unwanted characters
- if (!include(data[0])) {
+ if (!include(*data)) {
++data;
continue;
}