projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54446d7
)
reorder strftime to eliminate the incorrect indention level
author
Rich Felker
<dalias@aerifal.cx>
Sat, 27 Jul 2013 21:47:03 +0000
(17:47 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 27 Jul 2013 21:47:03 +0000
(17:47 -0400)
this change is in preparation for possibly adding support for the
field width and padding specifiers added in POSIX 2008.
src/time/strftime.c
patch
|
blob
|
history
diff --git
a/src/time/strftime.c
b/src/time/strftime.c
index 592b214d0ff6ac90c2a9b761303a944837b5b01f..96cb996de0b4f4a233435963241c284b8e8e1001 100644
(file)
--- a/
src/time/strftime.c
+++ b/
src/time/strftime.c
@@
-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;