X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fvdprintf.c;h=c35d9b4fb0412fdefb2f4a07c198b8de8b451871;hb=5271ff46b9e983bec5fd9ab79d5aaf096fa54157;hp=faf9536a7d529ee488c95d40c82b342b402c2a99;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/vdprintf.c b/src/stdio/vdprintf.c index faf9536a..c35d9b4f 100644 --- a/src/stdio/vdprintf.c +++ b/src/stdio/vdprintf.c @@ -5,15 +5,12 @@ static size_t wrap_write(FILE *f, const unsigned char *buf, size_t len) return __stdio_write(f, buf, len); } -int vdprintf(int fd, const char *fmt, va_list ap) +int vdprintf(int fd, const char *restrict fmt, va_list ap) { - int r; - unsigned char buf[BUFSIZ]; FILE f = { .fd = fd, .lbf = EOF, .write = wrap_write, - .buf = buf+UNGET, .buf_size = sizeof buf - UNGET, + .buf = (void *)fmt, .buf_size = 0, .lock = -1 }; - r = vfprintf(&f, fmt, ap); - return fflush(&f) ? EOF : r; + return vfprintf(&f, fmt, ap); }