If you do
char* str; you are trying to create a pointer to a null string. This didn't even compile for me. Did you do something slightly different? However, when you do
char str; you are allocating space in memory that can be initialized and changed over and over, which is exactly what you need.
I tested your code and it did print "END" for files with files less than 6 lines (1 word per line). If it was 6 or more, then "END" wouldn't print. However, it didn't print a '\n' line feed after END, so it was immediately followed by the operating systems' new line prompt. Is it possible you didn't notice it?
It's also possible that the 'small' file has been changed or that you are editing it in one directory and the program is processing a different copy in another direcory, or your are similarly editing one copy of the program and running another version.
If this answers your question, please accept this answer to remove the question from the unanswered question pool. Let's keep up on forum housekeeping. ;-)