fix: makes uri decode platform independent

This commit is contained in:
Matteo Pace 2023-11-08 17:32:41 +01:00
parent 5b094c0ce9
commit fcf205d599

View File

@ -99,8 +99,8 @@ std::string uri_decode(const std::string & sSrc) {
while (pSrc < SRC_LAST_DEC) { while (pSrc < SRC_LAST_DEC) {
if (*pSrc == '%') { if (*pSrc == '%') {
char dec1, dec2; char dec1, dec2;
if (-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)]) if ((char)-1 != (dec1 = string::HEX2DEC[*(pSrc + 1)])
&& -1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) { && (char)-1 != (dec2 = string::HEX2DEC[*(pSrc + 2)])) {
*pEnd++ = (dec1 << 4) + dec2; *pEnd++ = (dec1 << 4) + dec2;
pSrc += 3; pSrc += 3;
continue; continue;