Duh! Initialise the argument to sscanf() inside the loop, so it always gets a known...