]> git.saurik.com Git - wxWidgets.git/commitdiff
fix base64 computation for strings whose length modulo 3 is 2 (patch 1665520; bug...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Mar 2007 23:07:16 +0000 (23:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Mar 2007 23:07:16 +0000 (23:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/http.cpp

index b4a742c05b7f7d832d7649c91c0002def76351da..1f756b419d05d86ecacbf1fcc3f6e2b52d2cc788 100644 (file)
@@ -63,6 +63,7 @@ All:
 - Added wxCONFIG_USE_SUBDIR flag to wxFileConfig (Giuseppe Bilotta).
 - Added wxSearchCtrl::[Get|Set]DescriptiveText.
 - Fixed detection of number of processors under Linux 2.6
+- Fixed Base64 computation in wxHTTP (p_michalczyk)
 
 wxMSW
 
index af0512f967ac00ff9d6021a0a2f5d508d488648c..f5f73ea4611524da3da0f6c4ad96a6a01520cdd8 100644 (file)
@@ -139,7 +139,7 @@ wxString wxHTTP::GenerateAuthString(const wxString& user, const wxString& pass)
         if (len == 1) {
             buf << wxString::Format(wxT("%c="), base64[(from[0] << 4) & 0x30]);
         } else {
-            buf << wxString::Format(wxT("%c%c"), base64[(from[0] << 4) & 0x30] + ((from[1] >> 4) & 0xf), base64[(from[1] << 2) & 0x3c]);
+            buf << wxString::Format(wxT("%c%c"), base64[((from[0] << 4) & 0x30) | ((from[1] >> 4) & 0xf)], base64[(from[1] << 2) & 0x3c]);
         }
         buf << wxString::Format(wxT("="));
     }