Mercurial > sdl-ios-xcode
diff src/video/uikit/SDL_uikitappdelegate.m @ 4489:2bb1bfeee9e2
The arguments to main() should be NULL terminated (SuS v3 compliant)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 06 Jul 2010 22:26:03 -0700 |
parents | 8b03a20b320f |
children | 7b7da52e8775 |
line wrap: on
line diff
--- a/src/video/uikit/SDL_uikitappdelegate.m Tue Jul 06 22:08:19 2010 -0700 +++ b/src/video/uikit/SDL_uikitappdelegate.m Tue Jul 06 22:26:03 2010 -0700 @@ -42,11 +42,12 @@ /* store arguments */ forward_argc = argc; - forward_argv = (char **)malloc(argc * sizeof(char *)); + forward_argv = (char **)malloc((argc+1) * sizeof(char *)); for (i=0; i<argc; i++) { forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char)); strcpy(forward_argv[i], argv[i]); } + forward_argv[i] = NULL; /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */ UIApplicationMain(argc, argv, NULL, @"SDLUIKitDelegate");