From 9829c836089c44d5c8cc7e3d0f7007ab33b0cb1a Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Wed, 6 Feb 2013 02:31:55 -0500 Subject: Fix the loading screen for a ROM appearing for a split second after the splash screen. Fix uninitialised memory access in Check_LoadArg. --- source/nds/gui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/nds/gui.c b/source/nds/gui.c index f71f70f..5d969a2 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -3550,7 +3550,7 @@ u32 menu(u16 *screen, bool8 FirstInvocation) { first_load = 1; //try auto loading games passed through argv first - if(LoadGameAndItsData(argv[1])) + if(strlen(argv[1]) > 0 && LoadGameAndItsData(argv[1])) repeat = 0; else { @@ -4683,6 +4683,8 @@ static bool Get_Args(char *file, char **filebuf){ } int CheckLoad_Arg(){ + argv[0][0] = '\0'; // Initialise the first byte to be a NULL in case + argv[1][0] = '\0'; // there are no arguments to avoid uninit. memory char *argarray[2]; argarray[0] = argv[0]; argarray[1] = argv[1]; -- cgit v1.2.3