]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash if conversion of a command line argument to Unicode fails
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 6 Apr 2006 12:38:31 +0000 (12:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 6 Apr 2006 12:38:31 +0000 (12:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/init.cpp

index b27736deac2e3b5b5c842e0100fe1e89541ffde2..d126e10b8d465481cc8665e2ea2a83171ef0e38d 100644 (file)
@@ -179,7 +179,8 @@ static void ConvertArgsToUnicode(int argc, char **argv)
     gs_initData.argv = new wchar_t *[argc + 1];
     for ( int i = 0; i < argc; i++ )
     {
-        gs_initData.argv[i] = wxStrdup(wxConvLocal.cMB2WX(argv[i]));
+        wxWCharBuffer buf(wxConvLocal.cMB2WX(argv[i]));
+        gs_initData.argv[i] = buf ? wxStrdup(buf) : NULL;
     }
 
     gs_initData.argc = argc;