commit 30bf44b5d95c8a2abc56636d986814cc365ab45e
parent 94f3f1872a95d6fdd8f6aff8bfec86bbbf46041f
Author: Naveen Narayanan <zerous@simple-cc.org>
Date: Wed, 26 Aug 2020 14:08:54 +0200
libc: Fix strftime (time.h)
This patch processes the flags, embedded along with the modifiers for
conversion specifiers such as E and O, as though they were used
without them.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/libc/time/strftime.c b/src/libc/time/strftime.c
@@ -106,6 +106,10 @@ strftime(char * restrict s, size_t siz,
fill = '0';
width = 2;
+ if (*fmt == 'E' || *fmt == 'O') {
+ fmt++;
+ }
+
switch (*fmt++) {
case 'Z':
if (!tm->tm_zone)
@@ -173,7 +177,7 @@ strftime(char * restrict s, size_t siz,
case 'V':
case 'g':
case 'G':
- /* TODO */
+ inc = 0;
break;
case 'C':
val = tm->tm_year / 100;
@@ -231,10 +235,6 @@ strftime(char * restrict s, size_t siz,
case 'z':
inc = timezone(s, n, tm);
break;
- case 'E':
- case 'O':
- if (*fmt != '\0')
- fmt += 2;;
case '\0':
inc = 0;
--fmt;