mirror of
https://github.com/fluencelabs/musl
synced 2025-07-30 22:01:57 +00:00
reorder strftime to eliminate the incorrect indention level
this change is in preparation for possibly adding support for the field width and padding specifiers added in POSIX 2008.
This commit is contained in:
@@ -51,7 +51,11 @@ size_t __strftime_l(char *restrict s, size_t n, const char *restrict f, const st
|
||||
const char *fmt;
|
||||
size_t l;
|
||||
for (l=0; *f && l<n; f++) {
|
||||
if (*f == '%') {
|
||||
if (*f != '%') {
|
||||
literal:
|
||||
s[l++] = *f;
|
||||
continue;
|
||||
}
|
||||
do_fmt:
|
||||
switch (*++f) {
|
||||
case '%':
|
||||
@@ -192,10 +196,6 @@ do_fmt:
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
literal:
|
||||
s[l++] = *f;
|
||||
continue;
|
||||
number:
|
||||
l += snprintf(s+l, n-l, fmt, val);
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user