Mercurial > hg > orthanc
changeset 3332:79178122842c
fix warnings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Mar 2019 14:06:38 +0100 |
parents | a600e5e8bd1c |
children | 2a38e00a0638 |
files | Resources/ThirdParty/base64/base64.cpp |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/ThirdParty/base64/base64.cpp Fri Mar 22 10:26:32 2019 +0100 +++ b/Resources/ThirdParty/base64/base64.cpp Fri Mar 22 14:06:38 2019 +0100 @@ -158,15 +158,18 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + void base64_decode(std::string& result, const std::string &stringToDecode) { result.reserve(result.size() + stringToDecode.size() * 3 / 4 + 10); int val=0, valb=-8; - for (std::string::const_iterator c = stringToDecode.begin(); c != stringToDecode.end(); ++c) { - if (decode_indexes[*c] == -1) + for (std::string::const_iterator c = stringToDecode.begin(); c != stringToDecode.end(); ++c) + { + size_t index = static_cast<size_t>(*c); + if (decode_indexes[index] == -1) break; - val = (val<<6) + decode_indexes[*c]; + val = (val<<6) + decode_indexes[index]; valb += 6; if (valb>=0) { result.push_back(char((val>>valb)&0xFF));