The compiler is Tiny C Compiler. Also, the ungetch() that I'm using is completely defined in the example, it's not a library function. The author explains his code as:
When an extra char is read, it is put in the buffer. When the next char is read, if there is anything in the buffer, it is pulled first.
Just using those two facts, and forgetting about compilers, etc... I don't see how it's possible to get more than one char in the buffer, since the process that adds another (reading) will always empty out the one that's there first.