comparison test/checkkeys.c @ 493:806fcbde0af3

Fixed a crash bug in checkkeys.c (thanks John!)
author Sam Lantinga <slouken@libsdl.org>
date Mon, 16 Sep 2002 06:21:23 +0000
parents 30466f501b77
children be9c9c8f6d53
comparison
equal deleted inserted replaced
492:c59692dcdce0 493:806fcbde0af3
85 exit(1); 85 exit(1);
86 } 86 }
87 atexit(SDL_Quit); 87 atexit(SDL_Quit);
88 88
89 videoflags = SDL_SWSURFACE; 89 videoflags = SDL_SWSURFACE;
90 if ( strcmp(argv[1], "-fullscreen") == 0 ) { 90 while( argc > 1 ) {
91 videoflags |= SDL_FULLSCREEN; 91 --argc;
92 if ( argv[argc] && !strcmp(argv[argc], "-fullscreen") ) {
93 videoflags |= SDL_FULLSCREEN;
94 } else {
95 fprintf(stderr, "Usage: %s [-fullscreen]\n", argv[0]);
96 exit(1);
97 }
92 } 98 }
93 99
94 /* Set 640x480 video mode */ 100 /* Set 640x480 video mode */
95 if ( SDL_SetVideoMode(640, 480, 0, videoflags) == NULL ) { 101 if ( SDL_SetVideoMode(640, 480, 0, videoflags) == NULL ) {
96 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n", 102 fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",