Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

The arguments to main() should be NULL terminated (SuS v3 compliant)

  • Loading branch information
slouken committed Jul 7, 2010
1 parent 8037039 commit 72672398d550590429cca3e76a239abc2a584ec7
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/video/uikit/SDL_uikitappdelegate.m
@@ -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");

0 comments on commit 7267239

Please sign in to comment.