blob: fe328ac593f7e80e3df18583517da795e118935e [file] [log] [blame]
/*
* ungetc.c
*/
#include "stdioint.h"
int ungetc(int c, FILE *file)
{
struct _IO_file_pvt *f = stdio_pvt(file);
if (f->obytes || f->data <= f->buf)
return EOF;
*(--f->data) = c;
f->ibytes++;
return c;
}