Don't use "endless loops with break" if you can avoid them. Reorganise the break statement so that there is something else in the while() expression.