From 489bef2ace3c3c617f5bf78ded45a5b81fe2fd46 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Thu, 13 Aug 2020 13:48:50 -0400 Subject: add src/ to -I and exorcise ../ from #include --- src/time/strftime.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/time/strftime.c') 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 #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]; -- cgit v1.2.1