diff src/main/win32/SDL_win32_main.c @ 1659:14717b52abc0 SDL-1.3

Merge trunk-1.3-3
author Sam Lantinga <slouken@libsdl.org>
date Wed, 17 May 2006 08:18:28 +0000
parents 4aac8563c296
children 782fd950bd46 c121d94672cb 70e77cbba87c
line wrap: on
line diff
--- a/src/main/win32/SDL_win32_main.c	Mon May 01 06:58:33 2006 +0000
+++ b/src/main/win32/SDL_win32_main.c	Wed May 17 08:18:28 2006 +0000
@@ -121,8 +121,15 @@
 	return FALSE;
 }
 
+/* SDL_Quit() shouldn't be used with atexit() directly because
+   calling conventions may differ... */
+static void cleanup(void)
+{
+	SDL_Quit();
+}
+
 /* Remove the output files if there was no output written */
-static void __cdecl cleanup_output(void)
+static void cleanup_output(void)
 {
 #ifndef NO_STDIO_REDIRECT
 	FILE *file;
@@ -188,7 +195,7 @@
 	if ( bufp == NULL ) {
 		return OutOfMemory();
 	}
-	SDL_strlcpy(bufp, appname, n);
+	SDL_strlcpy(bufp, appname, n+1);
 	appname = bufp;
 
 	/* Load SDL dynamic link library */
@@ -197,7 +204,7 @@
 		return(FALSE);
 	}
 	atexit(cleanup_output);
-	atexit(SDL_Quit);
+	atexit(cleanup);
 
 	/* Sam:
 	   We still need to pass in the application handle so that