author | Rich Felker <dalias@aerifal.cx> | 2023年03月20日 19:07:54 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023年03月21日 09:11:17 -0400 |
commit | 3a051769c4a91c3a7d1f1310d888faa4abf363e7 (patch) | |
tree | 440dfaaaca3c36ade1b998a7585863850358be97 /src/stdio | |
parent | 0440ed69eac766c712e974358c3e09d63e330f40 (diff) | |
download | musl-3a051769c4a91c3a7d1f1310d888faa4abf363e7.tar.gz |
-rw-r--r-- | src/stdio/vfprintf.c | 3 |
diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 45557951..2dbdb5e2 100644 --- 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; |