mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
Merge pull request #8766 from brianmcgee/fix/base64-decode-error-message
base64Decode: clearer error message when an invalid character is detected
This commit is contained in:
commit
95f2b2beab
1 changed files with 3 additions and 2 deletions
|
@ -243,8 +243,9 @@ std::string base64Decode(std::string_view s)
|
||||||
if (c == '\n') continue;
|
if (c == '\n') continue;
|
||||||
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in a new issue