Rev 4973 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
5098 | clevermous | 3 | #include |
4973 | right-hear | 4 | #include |
5 | |||
6 | int |
||
7 | fprintf(register FILE *iop, const char *fmt, ...) |
||
8 | { |
||
9 | int len; |
||
10 | char localbuf[BUFSIZ]; |
||
11 | va_list va; |
||
12 | va_start(va, fmt); |
||
13 | if (iop->_flag & _IONBF) |
||
14 | { |
||
15 | iop->_flag &= ~_IONBF; |
||
16 | iop->_ptr = iop->_base = localbuf; |
||
17 | iop->_bufsiz = BUFSIZ; |
||
18 | len = _doprnt(fmt, va, iop); |
||
19 | fflush(iop); |
||
20 | iop->_flag |= _IONBF; |
||
21 | iop->_base = NULL; |
||
22 | iop->_bufsiz = NULL; |
||
23 | iop->_cnt = 0; |
||
24 | } |
||
25 | else |
||
26 | len = _doprnt(fmt, va, iop); |
||
27 | va_end(va); |
||
28 | return ferror(iop) ? EOF : len; |
||
29 | } |