]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed buffer overrun in call to wxStripMenuCodes()
authorGeorge Tasker <gtasker@allenbrook.com>
Sun, 28 Jan 2001 19:29:23 +0000 (19:29 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Sun, 28 Jan 2001 19:29:23 +0000 (19:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/ownerdrw.cpp

index f0f1223260634a4c685e8766623bf2cf12a4f7ea..b23fb671e2c7d4901f9f67a3be8eed8082a5b4f4 100644 (file)
@@ -73,11 +73,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
   wxMemoryDC dc;
   dc.SetFont(GetFont());
 
-  // ## ugly...
-  wxChar *szStripped = new wxChar[m_strName.Len()];
-  wxStripMenuCodes((wxChar *)m_strName.c_str(), szStripped);
-  wxString str = szStripped;
-  delete [] szStripped;
+  wxString str = wxStripMenuCodes(m_strName);
 
   // # without this menu items look too tightly packed (at least under Windows)
   str += wxT('W'); // 'W' is typically the widest letter