gigatron/rom/Archive/lcc/Libs/stdio/ungetc.c
2025-01-28 19:17:01 +03:00

14 lines
305 B
C

#include <stdio.h>
int ungetc(int c, FILE *stream)
{
#if 0 // Issue #76
if (c == EOF)
return c; // Fail without changing the FILE object
#endif
*(--stream->_ptr) = c; // XXX We don't really know if there's space
stream->_n++;
stream->_flags &= ~_ioeof;
return c;
}