Rev 4973 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| Download
| RSS feed
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdio.h>
#include <stdarg.h>
#include <libc/file.h>
int
fprintf(register FILE
*iop
, const char *fmt
, ...
)
{
int len;
char localbuf[BUFSIZ];
va_list va;
if (iop->_flag & _IONBF)
{
iop->_flag &= ~_IONBF;
iop->_ptr = iop->_base = localbuf;
iop->_bufsiz = BUFSIZ;
len = _doprnt(fmt, va, iop);
iop->_flag |= _IONBF;
iop->_base = NULL;
iop->_bufsiz = NULL;
iop->_cnt = 0;
}
else
len = _doprnt(fmt, va, iop);
return ferror(iop
) ? EOF
: len
;
}