diff options
author | Jakob Kaivo <jkk@ung.org> | 2020-08-13 13:48:50 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2020-08-13 13:48:50 -0400 |
commit | 489bef2ace3c3c617f5bf78ded45a5b81fe2fd46 (patch) | |
tree | f7df0cd2678ebe868356e9a00952555a28a75214 /src/time/strftime.c | |
parent | 3e282018ffb5806cafafeb5d0d6f8d67c9bb86e8 (diff) |
add src/ to -I and exorcise ../ from #include
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]; |