Well, I wouldn't just put it down entirely to a bug. Sometimes various compilers and systems protect you from yourself. If you compiled what I posted, and it still doesn't work, let me know. Make sure we're compiling the same program and using the same file.
Edit: Make sure there's a newline at the end of the file you use. Otherwise, you'll use an EOF char.