提交 d53b1f82 编写于 作者: R Rich Felker

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.
上级 54446d73
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册