don't dereference end iterator (closes #10656)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-29 21:04:55 +00:00
parent 6df09f32fd
commit 694cb6c581

View File

@@ -910,7 +910,7 @@ wxDateTime::ParseFormat(const wxString& date,
{ {
// a white space in the format string matches 0 or more white // a white space in the format string matches 0 or more white
// spaces in the input // spaces in the input
while ( wxIsspace(*input) ) while ( input != end && wxIsspace(*input) )
{ {
input++; input++;
} }
@@ -919,7 +919,7 @@ wxDateTime::ParseFormat(const wxString& date,
{ {
// any other character (not whitespace, not '%') must be // any other character (not whitespace, not '%') must be
// matched by itself in the input // matched by itself in the input
if ( *input++ != *fmt ) if ( input == end || *input++ != *fmt )
{ {
// no match // no match
return false; return false;