I think the point is, you claim to want to break the loop when the character is neither \0 NOR a space, but that's not the logic you've given. The logic you've given could never return false.
...