From 04c4e5f1770062401f183861d39fd0ec9ee0187a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Jun 2015 20:22:11 +0200 Subject: [PATCH] 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. --- tests/strings/unicode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/strings/unicode.cpp b/tests/strings/unicode.cpp index 610949ee7a..565bd7b22b 100644 --- a/tests/strings/unicode.cpp +++ b/tests/strings/unicode.cpp @@ -277,7 +277,7 @@ void UnicodeTestCase::ConversionWithNULs() wxString szTheString2("The\0String", wxConvLocal, lenNulString); CPPUNIT_ASSERT_EQUAL( lenNulString, szTheString2.length() ); CPPUNIT_ASSERT( wxTmemcmp(szTheString2.c_str(), L"The\0String", - lenNulString + 1) == 0 ); + lenNulString) == 0 ); #else // !wxUSE_UNICODE wxString szTheString("TheString"); szTheString.insert(3, 1, '\0');