Check for iterator validity when parsing "%%" in wxDateTime::Format() too.
This is similar to the previous commit and adds another missed check for the iterator not being at the end of string. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1448,7 +1448,7 @@ wxDateTime::ParseFormat(const wxString& date,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case wxT('%'): // a percent sign
|
case wxT('%'): // a percent sign
|
||||||
if ( *input++ != wxT('%') )
|
if ( input == end || *input++ != wxT('%') )
|
||||||
{
|
{
|
||||||
// no match
|
// no match
|
||||||
return false;
|
return false;
|
||||||
|
@@ -831,6 +831,7 @@ void DateTimeTestCase::TestTimeFormat()
|
|||||||
|
|
||||||
// test some degenerate cases
|
// test some degenerate cases
|
||||||
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );
|
CPPUNIT_ASSERT( !dt.ParseFormat("", "%z") );
|
||||||
|
CPPUNIT_ASSERT( !dt.ParseFormat("", "%%") );
|
||||||
|
|
||||||
// test compilation of some calls which should compile (and not result in
|
// test compilation of some calls which should compile (and not result in
|
||||||
// ambiguity because of char*<->wxCStrData<->wxString conversions)
|
// ambiguity because of char*<->wxCStrData<->wxString conversions)
|
||||||
|
Reference in New Issue
Block a user