simplify win32_modenv

This commit is contained in:
Niklas Larsson 2020-06-16 14:09:12 +02:00
parent 2e8f618f00
commit 0c7fc9b73c

View File

@ -75,9 +75,6 @@ void win32_sleep(int ms) {
}
int win32_modenv(const char* name, const char* value, int overwrite) {
char buffer[2000];
if (!overwrite && getenv(name)) return 0;
if (strlen(name) + strlen(value) > 1998) return -1;
sprintf(buffer, "%s=%s", name, value);
return putenv(buffer);
return _putenv_s(name, value);
}