As people have already pointed out, the program may enter erroneous state if the printf fails and returns a negative value not equal to EOF.
In your code, printf is not failing so, you aren't able to notice the difference.