| 3594 | } |
| 3595 | |
| 3596 | static int fgetc_unlocked(FILE *stream) |
| 3597 | { |
| 3598 | if (stdio_stream_read_init(stream) < 0) |
| 3599 | return EOF; |
| 3600 | if (stream->unget != EOF) |
| 3601 | { |
| 3602 | int c = stream->unget; |
| 3603 | stream->unget = EOF; |
| 3604 | return c; |
| 3605 | } |
| 3606 | if (stream->read_ptr == NULL) |
| 3607 | { |
| 3608 | char buf[1]; |
| 3609 | if (stdio_stream_read_buf(stream, buf, buf+1) < 0) |
| 3610 | return EOF; |
| 3611 | return (int)buf[0]; |
| 3612 | } |
| 3613 | char c = *stream->read_ptr++; |
| 3614 | return (int)c; |
| 3615 | } |
| 3616 | |
| 3617 | static int fgetc(FILE *stream) |
| 3618 | { |
no test coverage detected