comparison 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
comparison
equal deleted inserted replaced
1378:dc0e13e7e1ae 1379:c0a74f199ecf
700 } 700 }
701 701
702 if ( name ) { 702 if ( name ) {
703 #ifdef _WIN32_WCE 703 #ifdef _WIN32_WCE
704 /* WinCE uses the UNICODE version */ 704 /* WinCE uses the UNICODE version */
705 int nLen = SDL_strlen(name)+1; 705 size_t nLen = SDL_strlen(name)+1;
706 SDL_Appname = SDL_malloc(nLen*2); 706 SDL_Appname = SDL_malloc(nLen*2);
707 MultiByteToWideChar(CP_ACP, 0, name, -1, SDL_Appname, nLen); 707 MultiByteToWideChar(CP_ACP, 0, name, -1, SDL_Appname, nLen);
708 #else 708 #else
709 int nLen = SDL_strlen(name)+1; 709 size_t nLen = SDL_strlen(name)+1;
710 SDL_Appname = SDL_malloc(nLen); 710 SDL_Appname = SDL_malloc(nLen);
711 SDL_strcpy(SDL_Appname, name); 711 SDL_strlcpy(SDL_Appname, name, nLen);
712 #endif /* _WIN32_WCE */ 712 #endif /* _WIN32_WCE */
713 SDL_Appstyle = style; 713 SDL_Appstyle = style;
714 SDL_Instance = hInst ? hInst : SDL_GetModuleHandle(); 714 SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
715 } 715 }
716 716