diff --git a/test/acl_profiler_test.cpp b/test/acl_profiler_test.cpp index e6370966..03b8adb9 100644 --- a/test/acl_profiler_test.cpp +++ b/test/acl_profiler_test.cpp @@ -50,8 +50,8 @@ MT_TEST_GROUP(acl_profile) { enum { MAX_DEVICES = 100, m_num_devices_in_context = 3 }; void setup() { if (threadNum() == 0) { - char profile_runtime_env_var[] = "ACL_RUNTIME_PROFILING_ACTIVE=1"; - char profiler_timer_env_var[] = "ACL_PROFILE_TIMER=1"; + static char profile_runtime_env_var[] = "ACL_RUNTIME_PROFILING_ACTIVE=1"; + static char profiler_timer_env_var[] = "ACL_PROFILE_TIMER=1"; #ifdef _WIN32 _putenv(profile_runtime_env_var); _putenv(profiler_timer_env_var); diff --git a/test/acl_test.cpp b/test/acl_test.cpp index 890735fc..bc8664b1 100644 --- a/test/acl_test.cpp +++ b/test/acl_test.cpp @@ -188,27 +188,16 @@ SimpleString StringFrom(size_t x) { #endif void acl_test_unsetenv(const char *var) { - #ifdef _WIN32 - { - char buf[1000]; - sprintf(buf, "%s=", var); - _putenv(buf); - } + _putenv_s(var, ""); #else unsetenv(var); #endif - if (acl_getenv(var)) { - *(char *)0 = 0; - } } + void acl_test_setenv(const char *var, const char *value) { #ifdef _WIN32 - { - char buf[1000]; - sprintf(buf, "%s=%s", var, value); - _putenv(buf); - } + _putenv_s(var, value); #else setenv(var, value, 1); #endif