SDL: SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them.

From 3264e64738f02f4b50f50d98d11792c9cb43ef72 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 22 Nov 2023 17:34:39 -0500
Subject: [PATCH] SDL_RunApp: Make sure argc/argv are stable if the caller
 didn't define them.

Fixes #8246.
---
 src/core/SDL_runapp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/core/SDL_runapp.c b/src/core/SDL_runapp.c
index faa2a924bb83..bb5a602168c4 100644
--- a/src/core/SDL_runapp.c
+++ b/src/core/SDL_runapp.c
@@ -27,15 +27,14 @@
 DECLSPEC int
 SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
 {
-    char empty[1] = {0};
-    char* argvdummy[2] = { empty, NULL };
-
     (void)reserved;
 
     if(!argv)
     {
-        argc = 0;
         /* 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;
     }