Avoid reading one char beyond the buffer end in UnicodeTestCase.
Valgrind complains about reading beyond the end of buffer when using glibc std::string for wxString implementation under amd64 Linux. Don't suppose that the buffer has one extra null word at its end to avoid this.
This commit is contained in:
@@ -277,7 +277,7 @@ void UnicodeTestCase::ConversionWithNULs()
|
|||||||
wxString szTheString2("The\0String", wxConvLocal, lenNulString);
|
wxString szTheString2("The\0String", wxConvLocal, lenNulString);
|
||||||
CPPUNIT_ASSERT_EQUAL( lenNulString, szTheString2.length() );
|
CPPUNIT_ASSERT_EQUAL( lenNulString, szTheString2.length() );
|
||||||
CPPUNIT_ASSERT( wxTmemcmp(szTheString2.c_str(), L"The\0String",
|
CPPUNIT_ASSERT( wxTmemcmp(szTheString2.c_str(), L"The\0String",
|
||||||
lenNulString + 1) == 0 );
|
lenNulString) == 0 );
|
||||||
#else // !wxUSE_UNICODE
|
#else // !wxUSE_UNICODE
|
||||||
wxString szTheString("TheString");
|
wxString szTheString("TheString");
|
||||||
szTheString.insert(3, 1, '\0');
|
szTheString.insert(3, 1, '\0');
|
||||||
|
Reference in New Issue
Block a user