[klibc] Optimize fgetc() to read the buffer directly

If there is data in the buffer, optimize fgetc() to pull from the
buffer directly.  Continue to use _fread() to get data out of an empty
buffer.

This also speeds up fgets() since it calls fgetc().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
3 files changed