From: Vadim Zeitlin Date: Mon, 12 May 2008 11:22:39 +0000 (+0000) Subject: don't dereference end iterator X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1e678b9b9392d7e2897c96af79ed76acc75c9fe4 don't dereference end iterator git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 787e4df468..f055522190 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -779,15 +779,15 @@ int wxCmdLineParser::Parse(bool showUsage) } else // it's an option. not a switch { - switch ( (*p).GetValue() ) + switch ( p == end ? '\0' : (*p).GetValue() ) { - case _T('='): - case _T(':'): + case '=': + case ':': // the value follows ++p; break; - case 0: + case '\0': // the value is in the next argument if ( ++n == count ) {