]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed argv[0] out of bounds error (argc can be 0 when wxEntry is manually called...
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 11 Oct 2005 15:05:03 +0000 (15:05 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Tue, 11 Oct 2005 15:05:03 +0000 (15:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cmdline.cpp

index 197d0eb548d171c2367cf07ad8850da2016f58b2..1ca7d85a4fd7d5eb7c012be192ed90a3ee3cd351 100644 (file)
@@ -241,7 +241,8 @@ void wxCmdLineParserData::SetArguments(const wxString& cmdLine)
 {
     m_arguments.clear();
 
 {
     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);
 
 
     wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine);