It's probably just a matter of taste, but I would replace the goto by an if-else branch here.