From: Dimitri Schoolwerth Date: Tue, 11 Oct 2005 15:05:03 +0000 (+0000) Subject: fixed argv[0] out of bounds error (argc can be 0 when wxEntry is manually called... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b04ada921ff729afc57eff8a2d1f07cb32576342 fixed argv[0] out of bounds error (argc can be 0 when wxEntry is manually called in a plugin environment for example) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index 197d0eb548..1ca7d85a4f 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -241,7 +241,8 @@ void wxCmdLineParserData::SetArguments(const wxString& cmdLine) { m_arguments.clear(); - m_arguments.push_back(wxTheApp ? wxTheApp->argv[0] : _T("")); + m_arguments.push_back( + (wxTheApp && wxTheApp->argc > 0) ? wxTheApp->argv[0] : wxEmptyString); wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine);