From 11eb874682b980e611d45edaa2229aa646b97485 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 28 Feb 2019 20:29:49 -0500 Subject: move to global locale if thread locale isn't set for time --- src/time/strftime.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/time/strftime.c b/src/time/strftime.c index 61527ca9..9d9f10e1 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -17,6 +17,9 @@ size_t strftime(char * restrict s, size_t maxsize, const char * restrict format, ASSERT_NONNULL(timeptr); lc = __libc(THREAD_LOCALE); + if (lc->time[0] == '\0') { + lc = __libc(GLOBAL_LOCALE); + } for (i = 0; format[i] != '\0' && converted < maxsize; i++) { if (format[i] != '%') { -- cgit v1.2.1