diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index 8c7fc351e..305307feb 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -60,9 +60,7 @@ SDL_setenv(const char *name, const char *value, int overwrite) } if (!overwrite) { - char ch = 0; - const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch)); - if (len > 0) { + if (GetEnvironmentVariableA(name, NULL, 0) > 0) { return 0; /* asked not to overwrite existing value. */ } }