projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix (normal, narrow) printf erroneously processing %n after output errors
[musl]
/
src
/
stdio
/
vfprintf.c
diff --git
a/src/stdio/vfprintf.c
b/src/stdio/vfprintf.c
index
4555795
..
2dbdb5e
100644
(file)
--- a/
src/stdio/vfprintf.c
+++ b/
src/stdio/vfprintf.c
@@
-530,6
+530,9
@@
static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
if (!f) continue;
+ /* Do not process any new directives once in error state. */
+ if (ferror(f)) return -1;
+
z = buf + sizeof(buf);
prefix = "-+ 0X0x";
pl = 0;