Use do-while instead of a magic number. No functionality change.