diff src/main/win32/SDL_win32_main.c @ 1769:290b5baf2fca

Fixed bug #215 The current SVN trunk is missing the SDLCALL specifier at numerous locations. It has to be added for all (possibly user provided) callbacks. I stumbled over this while creating a makefile for the OpenWatcom compiler for Win32.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 07 May 2006 03:40:06 +0000
parents 4aac8563c296
children 782fd950bd46 c121d94672cb 70e77cbba87c
line wrap: on
line diff
--- a/src/main/win32/SDL_win32_main.c	Fri May 05 05:50:26 2006 +0000
+++ b/src/main/win32/SDL_win32_main.c	Sun May 07 03:40:06 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