diff --git a/src/util.hpp b/src/util.hpp index 1e61e3a95a3415..e84291a92b12e6 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -59,7 +59,7 @@ class Util { static std::string HexStr(const uint8_t* data, size_t len) { std::stringstream s; s << std::hex; - for (int i=0; i < len; ++i) + for (size_t i=0; i < len; ++i) s << std::setw(2) << std::setfill('0') << static_cast(data[i]); return s.str(); } @@ -67,7 +67,7 @@ class Util { static std::string HexStr(const std::vector &data) { std::stringstream s; s << std::hex; - for (int i=0; i < data.size(); ++i) + for (size_t i=0; i < data.size(); ++i) s << std::setw(2) << std::setfill('0') << static_cast(data[i]); return s.str(); }