diff options
Diffstat (limited to 'src/time/strftime.c')
-rw-r--r-- | src/time/strftime.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/time/strftime.c b/src/time/strftime.c index 4d306789..4d3f78c8 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -1,9 +1,8 @@ #include <time.h> #include "stdio.h" -#include "../_assert.h" +#include "_assert.h" #include "locale.h" -#include "../locale/_locale.h" -#include "../_nonstd.h" +#include "locale/_locale.h" /** convert time to a formatted string **/ @@ -11,17 +10,12 @@ size_t strftime(char * restrict s, size_t maxsize, const char * restrict format, { size_t converted = 0, i, j; char buf[64]; - struct __locale_t *lc; + struct __locale_t *lc = __get_locale(); ASSERT_NONNULL(s); ASSERT_NONNULL(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] != '%') { s[converted++] = format[i]; |