src/video/windib/SDL_dibevents.c
changeset 1336 3692456e7b0f
parent 1330 450721ad5436
child 1338 604d73db6802
     1.1 --- a/src/video/windib/SDL_dibevents.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/video/windib/SDL_dibevents.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -404,7 +404,7 @@
     1.4  
     1.5  int DIB_CreateWindow(_THIS)
     1.6  {
     1.7 -	char *windowid = getenv("SDL_WINDOWID");
     1.8 +	char *windowid = SDL_getenv("SDL_WINDOWID");
     1.9  
    1.10  	SDL_RegisterApp(NULL, 0, 0);
    1.11  
    1.12 @@ -412,12 +412,12 @@
    1.13  	if ( SDL_windowid ) {
    1.14  #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
    1.15  		/* wince 2.1 does not have strtol */
    1.16 -		wchar_t *windowid_t = malloc((strlen(windowid) + 1) * sizeof(wchar_t));
    1.17 -		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, strlen(windowid) + 1);
    1.18 +		wchar_t *windowid_t = SDL_malloc((SDL_strlen(windowid) + 1) * sizeof(wchar_t));
    1.19 +		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, SDL_strlen(windowid) + 1);
    1.20  		SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
    1.21 -		free(windowid_t);
    1.22 +		SDL_free(windowid_t);
    1.23  #else
    1.24 -		SDL_Window = (HWND)strtol(windowid, NULL, 0);
    1.25 +		SDL_Window = (HWND)SDL_strtol(windowid, NULL, 0);
    1.26  #endif
    1.27  		if ( SDL_Window == NULL ) {
    1.28  			SDL_SetError("Couldn't get user specified window");