Avoid an infinite loop while parsing an attribute at the end-of-string