From 081efa8f2618f87ab9046f0d6c7c59588719e813 Mon Sep 17 00:00:00 2001 From: libertyernie Date: Fri, 27 Jul 2018 21:52:04 -0500 Subject: [PATCH] Allow loader (e.g. Homebrew Channel) to pass two arguments instead of three for autoload --- source/snes9xgx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/snes9xgx.cpp b/source/snes9xgx.cpp index b31f31f..0f33f38 100644 --- a/source/snes9xgx.cpp +++ b/source/snes9xgx.cpp @@ -464,7 +464,7 @@ int main(int argc, char *argv[]) InitGUIThreads(); bool autoboot = false; - if(argc > 3 && argv[1] != NULL && argv[2] != NULL && argv[3] != NULL) + if(argc > 2 && argv[1] != NULL && argv[2] != NULL) { autoboot = true; ResetBrowser(); @@ -487,7 +487,7 @@ int main(int argc, char *argv[]) strncpy(arg_filename, argv[2], sizeof(arg_filename)); strncpy(GCSettings.LoadFolder, dir.c_str(), sizeof(GCSettings.LoadFolder)); OpenGameList(); - strncpy(GCSettings.Exit_Dol_File, argv[3], sizeof(GCSettings.Exit_Dol_File)); + strncpy(GCSettings.Exit_Dol_File, argv[3] != NULL ? argv[3] : "", sizeof(GCSettings.Exit_Dol_File)); if(argc > 5 && argv[4] != NULL && argv[5] != NULL) { sscanf(argv[4], "%08x", &GCSettings.Exit_Channel[0]);