Ah, that's because you "wait for user input" using getchar() at the end of the program, but if have entered 8000 characters, and fgets() accepted 149 of them, the first of the 7851 left overof will happily be received by getchar(), and your program finishes. So it's doing exactly what you expect.
--
Mats

