From cbdda631dbd68765203d1843f217f47c6e0c5c48 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 20 Sep 2020 00:05:41 +0200 Subject: [PATCH] base64: fixes the error message for an invalid base64 input character [backport:1.2] --- lib/pure/base64.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/base64.nim b/lib/pure/base64.nim index 9495c4d56a..40c9af9056 100644 --- a/lib/pure/base64.nim +++ b/lib/pure/base64.nim @@ -230,11 +230,11 @@ proc decode*(s: string): string = template inputChar(x: untyped) = let x = int decodeTable[ord(s[inputIndex])] - inc inputIndex if x == invalidChar: raise newException(ValueError, "Invalid base64 format character `" & s[inputIndex] & "` (ord " & $s[inputIndex].ord & ") at location " & $inputIndex & ".") + inc inputIndex template outputChar(x: untyped) = result[outputIndex] = char(x and 255)