From 0e0809b5f5153d0f0243809fc4ceaadbd6f9d5d7 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 38ae48a249..dd89d1b490 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');