diff --git a/blankie/murl.cpp b/blankie/murl.cpp index 2dddfc0..2c69865 100644 --- a/blankie/murl.cpp +++ b/blankie/murl.cpp @@ -189,20 +189,20 @@ static inline void hexencode(char c, char out[2]) { char nibble1 = (c >> 4) & 0xF; char nibble2 = c & 0xF; - auto hexencode = [](char nibble) -> char { - return nibble < 10 + auto hexencode = [](char nibble) { + return static_cast(nibble < 10 ? '0' + nibble - : 'A' + nibble - 10; + : 'A' + nibble - 10); }; out[0] = hexencode(nibble1); out[1] = hexencode(nibble2); } static inline char hexdecode(char nibble1, char nibble2) { - auto hexdecode = [](char nibble) -> char { - if (nibble >= '0' && nibble <= '9') return nibble - '0'; - if (nibble >= 'A' && nibble <= 'F') return nibble - 'A' + 10; - if (nibble >= 'a' && nibble <= 'f') return nibble - 'a' + 10; + auto hexdecode = [](char nibble) { + if (nibble >= '0' && nibble <= '9') return static_cast(nibble - '0'); + if (nibble >= 'A' && nibble <= 'F') return static_cast(nibble - 'A' + 10); + if (nibble >= 'a' && nibble <= 'f') return static_cast(nibble - 'a' + 10); throw std::invalid_argument("Invalid percent-encoded nibble received"); };