diff --git a/src/env/stdc.c b/src/env/stdc.c
index f229dd3..faffa59 100644
--- a/src/env/stdc.c
+++ b/src/env/stdc.c
@@ -32,22 +32,23 @@ char *xstrtok(char *s1, const char *s2)
 
 #elif defined(__WOE__)
 
-#define ENABLE_NON_SAFE
 #include "stdc.h"
 
 struct tm *xgmtime(const time_t *timer)
-{     return
-         gmtime(timer);
+{     static TLS struct tm result;
+      gmtime_s(&result, timer);
+      return &result;
 }
 
 char *xstrerr(int errnum)
-{     return
-         strerror(errnum);
+{     static TLS char s[255+1];
+      strerror_s(s, sizeof(s), errnum);
+      return s;
 }
 
 char *xstrtok(char *s1, const char *s2)
-{     return
-         strtok(s1, s2);
+{     static TLS char *ptr;
+      return strtok_s(s1, s2, &ptr);
 }
 
 /* GNU/Linux version **************************************************/
