src/main/win32/SDL_win32_main.c
branchSDL-1.3
changeset 1659 14717b52abc0
parent 1472 4aac8563c296
child 1662 782fd950bd46
child 1895 c121d94672cb
child 4084 70e77cbba87c
     1.1 --- a/src/main/win32/SDL_win32_main.c	Mon May 01 06:58:33 2006 +0000
     1.2 +++ b/src/main/win32/SDL_win32_main.c	Wed May 17 08:18:28 2006 +0000
     1.3 @@ -121,8 +121,15 @@
     1.4  	return FALSE;
     1.5  }
     1.6  
     1.7 +/* SDL_Quit() shouldn't be used with atexit() directly because
     1.8 +   calling conventions may differ... */
     1.9 +static void cleanup(void)
    1.10 +{
    1.11 +	SDL_Quit();
    1.12 +}
    1.13 +
    1.14  /* Remove the output files if there was no output written */
    1.15 -static void __cdecl cleanup_output(void)
    1.16 +static void cleanup_output(void)
    1.17  {
    1.18  #ifndef NO_STDIO_REDIRECT
    1.19  	FILE *file;
    1.20 @@ -188,7 +195,7 @@
    1.21  	if ( bufp == NULL ) {
    1.22  		return OutOfMemory();
    1.23  	}
    1.24 -	SDL_strlcpy(bufp, appname, n);
    1.25 +	SDL_strlcpy(bufp, appname, n+1);
    1.26  	appname = bufp;
    1.27  
    1.28  	/* Load SDL dynamic link library */
    1.29 @@ -197,7 +204,7 @@
    1.30  		return(FALSE);
    1.31  	}
    1.32  	atexit(cleanup_output);
    1.33 -	atexit(SDL_Quit);
    1.34 +	atexit(cleanup);
    1.35  
    1.36  	/* Sam:
    1.37  	   We still need to pass in the application handle so that