diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-02-28 20:29:49 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-02-28 20:29:49 -0500 |
commit | 11eb874682b980e611d45edaa2229aa646b97485 (patch) | |
tree | 8948293f10783ae6c89eea19d553658ce32742a9 /src/time/strftime.c | |
parent | c7bff22b921521a0ab53710d7c03a70efceee4f9 (diff) |
move to global locale if thread locale isn't set for time
Diffstat (limited to 'src/time/strftime.c')
-rw-r--r-- | src/time/strftime.c | 3 |
1 files changed, 3 insertions, 0 deletions
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] != '%') { |