| 3457 | } |
| 3458 | |
| 3459 | static int fputc_unlocked(int c, FILE *stream) |
| 3460 | { |
| 3461 | if (stdio_stream_write_init(stream) < 0) |
| 3462 | return EOF; |
| 3463 | char d = (char)c; |
| 3464 | if (stream->write_ptr == NULL) |
| 3465 | { |
| 3466 | if (stdio_stream_write_buf(stream, &d, &d + sizeof(d)) < 0) |
| 3467 | return EOF; |
| 3468 | return (int)d; |
| 3469 | } |
| 3470 | *stream->write_ptr++ = d; |
| 3471 | if ((int)(unsigned char)d == stream->eol && stdio_stream_write(stream) < 0) |
| 3472 | return EOF; |
| 3473 | return (int)d; |
| 3474 | } |
| 3475 | |
| 3476 | static int fputc(int c, FILE *stream) |
| 3477 | { |
no test coverage detected