src/stdlib/SDL_getenv.c
changeset 11232 b26929d6ca20
parent 10737 3406a0f8b041
     1.1 --- a/src/stdlib/SDL_getenv.c	Fri Aug 11 21:17:10 2017 -0700
     1.2 +++ b/src/stdlib/SDL_getenv.c	Fri Aug 11 21:30:06 2017 -0700
     1.3 @@ -60,9 +60,7 @@
     1.4      }
     1.5      
     1.6      if (!overwrite) {
     1.7 -        char ch = 0;
     1.8 -        const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch));
     1.9 -        if (len > 0) {
    1.10 +        if (GetEnvironmentVariableA(name, NULL, 0) > 0) {
    1.11              return 0;  /* asked not to overwrite existing value. */
    1.12          }
    1.13      }