calling wcsnlen(NULL) does crash (under Debian and, according to the docs, should also crash with MSVC), contrary to what the comment claimed so don't do this
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
213b5041fe
commit
166523d8d7
@ -213,12 +213,6 @@ void CrtTestCase::Strpbrk()
|
||||
|
||||
void CrtTestCase::Strnlen()
|
||||
{
|
||||
// the following calls should not segfault/crash because when passing 0
|
||||
// as maxlen, no bytes at all should be read from the given buffer
|
||||
// (which is NULL in this case!)
|
||||
CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen((const char*)NULL, 0) );
|
||||
CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen((const wchar_t*)NULL, 0) );
|
||||
|
||||
// other misc tests for wxStrnlen(const char*, size_t)
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL( (size_t)0, wxStrnlen("", 0) );
|
||||
|
Loading…
Reference in New Issue
Block a user