commit | ef3697545bc7fadec43001fa3c8376426510b9ea | [log] [tgz] |
---|---|---|
author | Jeff Sharkey <jsharkey@android.com> | Wed Apr 29 15:57:48 2015 -0700 |
committer | Jeff Sharkey <jsharkey@android.com> | Wed Apr 29 15:57:48 2015 -0700 |
tree | 2414d97a76e7a161c8597188ca53f7c9f6f56b6f | |
parent | ba6747f119811032b258cf3c6334a4d0f9b675bf [diff] [blame] |
Fix signed issue with hex conversion. Change-Id: Ia11c689c373f41b2a63bc84151eb16f7c7b9d155
diff --git a/Utils.cpp b/Utils.cpp index 158a61e..f45907a 100644 --- a/Utils.cpp +++ b/Utils.cpp
@@ -381,7 +381,7 @@ status_t StrToHex(const std::string& str, std::string& hex) { hex.clear(); for (size_t i = 0; i < str.size(); i++) { - hex.push_back(kLookup[str[i] >> 4]); + hex.push_back(kLookup[(str[i] & 0xF0) >> 4]); hex.push_back(kLookup[str[i] & 0x0F]); } return OK;