Fix to_hex_if_need function on string utils

This fix issue #1535. Solution was the same suggested on #1523.
This commit is contained in:
Felipe Zimmerle 2017-08-21 22:39:26 -03:00
parent 8d6209f652
commit 4b9bd499eb
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -136,7 +136,7 @@ std::string toHexIfNeeded(const std::string &str) {
std::stringstream res;
for (int i = 0; i < str.size(); i++) {
int c = str.at(i);
int c = (unsigned char)str.at(i);
if (c < 32 || c > 126) {
res << "\\x" << std::setw(2) << std::setfill('0') << std::hex << c;
} else {