diff --git a/docs/changes.txt b/docs/changes.txt index da3ced218a..a329e0482c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -107,6 +107,7 @@ All: - Implemented background colour in wxRichTextCtrl. - Fixed crashes in helpview when opening a file. - Fixed detection of number of processors under Linux 2.6 +- Fixed Base64 computation in wxHTTP (p_michalczyk) wxMSW diff --git a/src/common/http.cpp b/src/common/http.cpp index af0512f967..f5f73ea461 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -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("=")); }