Compare commits

...

1 commit

Author SHA1 Message Date
Brian McGee 2c095fa5a6 base64Decode: clearer error message when an invalid character is detected
Output the offending string in its entirety to provide context.

(cherry picked from commit dc3ccf02bfd4d359228b54f5c24ae2b6caf6428e)
2024-09-17 18:14:07 -06:00

View file

@ -182,7 +182,7 @@ std::string base64Decode(std::string_view s)
char digit = base64DecodeChars[(unsigned char) c]; char digit = base64DecodeChars[(unsigned char) c];
if (digit == npos) if (digit == npos)
throw Error("invalid character in Base64 string: '%c'", c); throw Error("invalid character in Base64 string: '%c' in '%s'", c, s.data());
bits += 6; bits += 6;
d = d << 6 | digit; d = d << 6 | digit;