]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
more efficient implementation of ToAscii/FromAscii in UTF8 build
[wxWidgets.git] / src / common / http.cpp
index af0512f967ac00ff9d6021a0a2f5d508d488648c..f8977ecedffbf4188ad68b02ff431eba1e476605 100644 (file)
@@ -139,9 +139,9 @@ 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("="));
+        buf << wxT("=");
     }
 
     return buf;
@@ -309,7 +309,7 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req)
 
     m_http_response = wxAtoi(tmp_str2);
 
-    switch (tmp_str2[0u])
+    switch ( tmp_str2[0u].GetValue() )
     {
         case wxT('1'):
             /* INFORMATION / SUCCESS */