mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them.
Fixes #8246.
This commit is contained in:
@@ -27,15 +27,14 @@
|
|||||||
DECLSPEC int
|
DECLSPEC int
|
||||||
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
|
SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
|
||||||
{
|
{
|
||||||
char empty[1] = {0};
|
|
||||||
char* argvdummy[2] = { empty, NULL };
|
|
||||||
|
|
||||||
(void)reserved;
|
(void)reserved;
|
||||||
|
|
||||||
if(!argv)
|
if(!argv)
|
||||||
{
|
{
|
||||||
argc = 0;
|
|
||||||
/* make sure argv isn't NULL, in case some user code doesn't like that */
|
/* make sure argv isn't NULL, in case some user code doesn't like that */
|
||||||
|
static char dummyargv0[] = { 'S', 'D', 'L', '_', 'a', 'p', 'p', '\0' };
|
||||||
|
static char* argvdummy[2] = { dummyargv0, NULL };
|
||||||
|
argc = 1;
|
||||||
argv = argvdummy;
|
argv = argvdummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user