Infinite while loop

The reason for the infinite loop error is that there is no condition change during the loop.

This is not the use case for it. A simple branch should do.