From c536e0fbdc7ff93f2571c7f1e405a912d1af15ee Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 5 Apr 2016 20:53:02 +0200 Subject: [PATCH] (iOS) argv needs to always be non-NULL --- retroarch.c | 5 +---- ui/drivers/ui_cocoatouch.m | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/retroarch.c b/retroarch.c index 2a5d4b7595..648bbdc38f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -714,10 +714,7 @@ static void parse_input(int argc, char *argv[]) for (;;) { int port; - int c = -1; - - if (argv != NULL) - c = getopt_long(argc, argv, optstring, opts, NULL); + int c = getopt_long(argc, argv, optstring, opts, NULL); if (c == -1) break; diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index dbe183c3ea..f511a46308 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -331,11 +331,13 @@ enum - (void)applicationDidFinishLaunching:(UIApplication *)application { - apple_platform = self; + const char *argv[] = {"retroarch", NULL}; + int argc = 1; + apple_platform = self; [self setDelegate:self]; - if (rarch_main(0, NULL, NULL)) + if (rarch_main(argc, argv, NULL)) apple_rarch_exited(); #ifdef HAVE_AVFOUNDATION