]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileconf.cpp
Add accelerator back to label in GetItemLabel
[wxWidgets.git] / src / common / fileconf.cpp
index ab3c4a0f498435e2e7470dab5fb711b705ef7f28..635c18a6ac516a417561b8fca372ebe23e780744 100644 (file)
@@ -458,7 +458,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, const wxMBConv& conv)
 
 #if wxUSE_UNICODE
     size_t len;
-    cbuf = conv.cMB2WC((char *)buf.GetData(), buf.GetDataLen(), &len);
+    cbuf = conv.cMB2WC((char *)buf.GetData(), buf.GetDataLen() + 1, &len);
     if ( !len && buf.GetDataLen() )
     {
         wxLogError(_("Failed to read config options."));
@@ -479,7 +479,8 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, const wxMBConv& conv)
 
         // notice that we throw away the original EOL kind here, maybe we
         // should preserve it?
-        memText.AddLine(wxString(s, e));
+        if ( e != s )
+            memText.AddLine(wxString(s, e));
 
         if ( *e == '\0' )
             break;