forked from mirror/openmw-tes3mp
Fix setting of longer environmental variables on Windows
This commit is contained in:
parent
804259b2c9
commit
35de28e239
1 changed files with 2 additions and 6 deletions
|
@ -14,12 +14,8 @@ using namespace std;
|
|||
#ifdef _WIN32
|
||||
int setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
std::unique_ptr<char> tmp(new char[strlen(name) + strlen(value) + 1]);
|
||||
sprintf(tmp.get(), "%s=%s", name, value);
|
||||
|
||||
printf("%s\n",tmp.get());
|
||||
|
||||
return putenv((const char*)tmp.get());
|
||||
printf("%s: %s\n", name, value);
|
||||
return _putenv_s(name, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue