From e6029e47754526c0cf03164d6ff9b30819e1ab2b Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 8 Jan 2007 20:43:17 +0000 Subject: Fix two bugs reported by Zack Weinberg in Base64_Decoder --- src/base64.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/base64.cpp b/src/base64.cpp index 9511525a6..6cfdc921e 100644 --- a/src/base64.cpp +++ b/src/base64.cpp @@ -169,13 +169,15 @@ void Base64_Decoder::decode_and_send(const byte block[], u32bit length) *************************************************/ void Base64_Decoder::handle_bad_char(byte c) { - if(checking == NONE) + if(c == '=' || checking == NONE) return; if((checking == IGNORE_WS) && Charset::is_space(c)) return; - throw Decoding_Error("Base64_Decoder: Invalid base64 character: " + c); + throw Decoding_Error( + std::string("Base64_Decoder: Invalid base64 character '") + (char)c + "'" + ); } /************************************************* -- cgit v1.2.3