From 04ae4db71a01d24cf97bd6414e7d796f6166753f Mon Sep 17 00:00:00 2001 From: prozacx Date: Tue, 20 Sep 2005 01:56:07 +0000 Subject: [PATCH] Fixed Base64Decode() to be binary safe git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@512 726aef4b-f618-498e-8847-2d620e286838 --- String.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/String.cpp b/String.cpp index ff2d974d..b98b8c5f 100644 --- a/String.cpp +++ b/String.cpp @@ -2,6 +2,7 @@ #include "String.h" #include "FileUtils.h" #include "MD5.h" +#include "main.h" const char* g_szHTMLescapes[256] = { "�", 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-9 @@ -502,7 +503,8 @@ unsigned long CString::Base64Decode(CString& sRet) const { *p = '\0'; unsigned long uRet = p - out; - sRet = out; + sRet.clear(); + sRet.append(out, uRet); free(out); return uRet;