fix aliasing-based undefined behavior in mbsrtowcs
[musl] / src / time / localtime.c
index abd5e84..5210423 100644 (file)
@@ -1,12 +1,7 @@
-#include <time.h>
-
-#include "__time.h"
+#include "time_impl.h"
 
 struct tm *localtime(const time_t *t)
 {
        static struct tm tm;
-       __tzset();
-       __time_to_tm(*t - __timezone, &tm);
-       tm.tm_isdst = -1;
-       return __dst_adjust(&tm);
+       return __localtime_r(t, &tm);
 }