diff src/video/wincommon/SDL_sysevents.c @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 19418e4422cb
children d910939febfa
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sun Feb 19 23:46:34 2006 +0000
@@ -702,13 +702,13 @@
 	if ( name ) {
 #ifdef _WIN32_WCE
 		/* WinCE uses the UNICODE version */
-		int nLen = SDL_strlen(name)+1;
+		size_t nLen = SDL_strlen(name)+1;
 		SDL_Appname = SDL_malloc(nLen*2);
 		MultiByteToWideChar(CP_ACP, 0, name, -1, SDL_Appname, nLen);
 #else
-		int nLen = SDL_strlen(name)+1;
+		size_t nLen = SDL_strlen(name)+1;
 		SDL_Appname = SDL_malloc(nLen);
-		SDL_strcpy(SDL_Appname, name);
+		SDL_strlcpy(SDL_Appname, name, nLen);
 #endif /* _WIN32_WCE */
 		SDL_Appstyle = style;
 		SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();