Commit 38cfc748 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Bugfix from Corona688: don't reference a string before we've initialized it.

 Fixes crashbug on WinCE (PocketPC).

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40422
parent 316a36b8
......@@ -335,11 +335,18 @@ int DIB_CreateWindow(_THIS)
{
#ifdef _WIN32_WCE
/* WinCE uses the UNICODE version */
int nLen = strlen(SDL_Appname)+1;
LPWSTR lpszW = alloca(nLen*2);
MultiByteToWideChar(CP_ACP, 0, SDL_Appname, -1, lpszW, nLen);
int nLen;
LPWSTR lpszW;
if ( SDL_RegisterApp("SDL_app", 0, 0) != 0 ) {
return -1;
}
nLen = strlen(SDL_Appname) + 1;
lpszW = alloca(nLen * 2);
MultiByteToWideChar(CP_ACP, 0, "SDL_App", -1, lpszW, nLen);
SDL_RegisterApp("SDL_app", 0, 0);
SDL_Window = CreateWindow(lpszW, lpszW, WS_VISIBLE,
0, 0, 0, 0, NULL, NULL, SDL_Instance, NULL);
if ( SDL_Window == NULL ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment