Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
The arguments to main() should be NULL terminated (SuS v3 compliant)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 7, 2010
1 parent 8037039 commit 7267239
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/uikit/SDL_uikitappdelegate.m
Expand Up @@ -42,11 +42,12 @@ int main(int argc, char **argv) {

/* 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");
Expand Down

0 comments on commit 7267239

Please sign in to comment.