don't crash if conversion of a command line argument to Unicode fails
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -179,7 +179,8 @@ static void ConvertArgsToUnicode(int argc, char **argv)
|
|||||||
gs_initData.argv = new wchar_t *[argc + 1];
|
gs_initData.argv = new wchar_t *[argc + 1];
|
||||||
for ( int i = 0; i < argc; i++ )
|
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;
|
gs_initData.argc = argc;
|
||||||
|
Reference in New Issue
Block a user