don't dereference end iterator

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-05-12 11:22:39 +00:00
parent 166fbaa46a
commit 1e678b9b93

View File

@@ -779,15 +779,15 @@ int wxCmdLineParser::Parse(bool showUsage)
} }
else // it's an option. not a switch else // it's an option. not a switch
{ {
switch ( (*p).GetValue() ) switch ( p == end ? '\0' : (*p).GetValue() )
{ {
case _T('='): case '=':
case _T(':'): case ':':
// the value follows // the value follows
++p; ++p;
break; break;
case 0: case '\0':
// the value is in the next argument // the value is in the next argument
if ( ++n == count ) if ( ++n == count )
{ {