From f4c2425d02833d463c2ea5052c97cffea1305c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 31 Jul 2014 03:00:39 -0300 Subject: [PATCH] Small fix in Base64. --- src/eepp/system/base64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eepp/system/base64.cpp b/src/eepp/system/base64.cpp index 224e8b683..6592e05d3 100644 --- a/src/eepp/system/base64.cpp +++ b/src/eepp/system/base64.cpp @@ -94,7 +94,7 @@ bool Base64::Encode(const std::string & in, std::string & out) { int len = Encode( in.size(), (const unsigned char*)in.c_str(), out.size(), (char*)&out[0] ); - if ( -1 != len ) { + if ( -1 != len && (size_t)len != out.size() ) { out.resize( len ); } @@ -110,7 +110,7 @@ bool Base64::Decode(const std::string & in, std::string & out) { int len = Decode( in.size(), in.c_str(), out.size(), (unsigned char*)&out[0] ); - if ( -1 != len && (size_t)len != d64len ) { + if ( -1 != len && (size_t)len != out.size() ) { out.resize( len ); }