changeset 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 6dc6a2bdd55e
children 06c7423f8c60
files src/video/uikit/SDL_uikitappdelegate.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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");