comparison src/stdlib/SDL_getenv.c @ 1456:84de7511f79f

Fixed a bunch of 64-bit compatibility problems
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Mar 2006 09:43:47 +0000
parents bb6839704ed6
children 4aac8563c296
comparison
equal deleted inserted replaced
1455:f487bb150acc 1456:84de7511f79f
31 #include <windows.h> 31 #include <windows.h>
32 32
33 /* Note this isn't thread-safe! */ 33 /* Note this isn't thread-safe! */
34 34
35 static char *SDL_envmem = NULL; /* Ugh, memory leak */ 35 static char *SDL_envmem = NULL; /* Ugh, memory leak */
36 static DWORD SDL_envmemlen = 0; 36 static size_t SDL_envmemlen = 0;
37 37
38 /* Put a variable of the form "name=value" into the environment */ 38 /* Put a variable of the form "name=value" into the environment */
39 int SDL_putenv(const char *variable) 39 int SDL_putenv(const char *variable)
40 { 40 {
41 DWORD bufferlen; 41 size_t bufferlen;
42 char *value; 42 char *value;
43 const char *sep; 43 const char *sep;
44 44
45 sep = SDL_strchr(variable, '='); 45 sep = SDL_strchr(variable, '=');
46 if ( sep == NULL ) { 46 if ( sep == NULL ) {
65 } 65 }
66 66
67 /* Retrieve a variable named "name" from the environment */ 67 /* Retrieve a variable named "name" from the environment */
68 char *SDL_getenv(const char *name) 68 char *SDL_getenv(const char *name)
69 { 69 {
70 DWORD bufferlen; 70 size_t bufferlen;
71 71
72 bufferlen = GetEnvironmentVariable(name, SDL_envmem, SDL_envmemlen); 72 bufferlen = GetEnvironmentVariable(name, SDL_envmem, SDL_envmemlen);
73 if ( bufferlen == 0 ) { 73 if ( bufferlen == 0 ) {
74 return NULL; 74 return NULL;
75 } 75 }