comparison 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
comparison
equal deleted inserted replaced
4488:6dc6a2bdd55e 4489:2bb1bfeee9e2
40 int i; 40 int i;
41 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 41 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
42 42
43 /* store arguments */ 43 /* store arguments */
44 forward_argc = argc; 44 forward_argc = argc;
45 forward_argv = (char **)malloc(argc * sizeof(char *)); 45 forward_argv = (char **)malloc((argc+1) * sizeof(char *));
46 for (i=0; i<argc; i++) { 46 for (i=0; i<argc; i++) {
47 forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char)); 47 forward_argv[i] = malloc( (strlen(argv[i])+1) * sizeof(char));
48 strcpy(forward_argv[i], argv[i]); 48 strcpy(forward_argv[i], argv[i]);
49 } 49 }
50 forward_argv[i] = NULL;
50 51
51 /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */ 52 /* Give over control to run loop, SDLUIKitDelegate will handle most things from here */
52 UIApplicationMain(argc, argv, NULL, @"SDLUIKitDelegate"); 53 UIApplicationMain(argc, argv, NULL, @"SDLUIKitDelegate");
53 54
54 [pool release]; 55 [pool release];