]> git.saurik.com Git - wxWidgets.git/commitdiff
memory corruption fixes
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 9 Nov 2004 11:02:58 +0000 (11:02 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 9 Nov 2004 11:02:58 +0000 (11:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/regex/wxregextest.cpp

index fd8f19251fbeb27a50374bb54fb8f8c05ffbefe0..6e798a1821d8d92203a0286ca69daca02d89714b 100644 (file)
@@ -113,9 +113,9 @@ void RegExMatchTestCase::runTest()
             wxString msgstr;
             msgstr.Printf(_T("\\%d == '%s' (expected '%s')"),
                           (int)i, result.c_str(), expected.c_str());
-            const char *msg = msgstr.mb_str();
 
-            CPPUNIT_ASSERT_MESSAGE(msg, result == expected);
+            CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(),
+                                   result == expected);
         }
 
         if ((m_flags & wxRE_NOSUB) == 0)
@@ -166,12 +166,10 @@ void RegExReplaceTestCase::runTest()
 
     wxString msgstr;
     msgstr.Printf(_T("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str());
-    const char *msg = msgstr.mb_str();
-    CPPUNIT_ASSERT_MESSAGE(msg, text == m_expected);
+    CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), text == m_expected);
 
     msgstr.Printf(_T("matches %d times (expected %d)"), nRepl, m_count);
-    msg = msgstr.mb_str();
-    CPPUNIT_ASSERT_MESSAGE(msg, nRepl == m_count);
+    CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), nRepl == m_count);
 }