mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-04 03:32:27 +00:00
Support printf %n directive
This commit is contained in:
parent
c1a0b017e9
commit
01b09bc817
8 changed files with 21 additions and 8 deletions
|
@ -87,7 +87,7 @@ int vfprintf_unlocked(FILE *f, const char *fmt, va_list va) {
|
|||
st.f = f;
|
||||
st.n = 0;
|
||||
st.b.n = 0;
|
||||
if ((rc = __fmt(out, &st, fmt, va)) != -1) {
|
||||
if ((rc = __fmt(out, &st, fmt, va, &st.n)) != -1) {
|
||||
if (!st.b.n) {
|
||||
rc = st.n;
|
||||
} else if (fwrite_unlocked(st.b.p, 1, st.b.n, st.f)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue