Fix an infinite loop in the parsing of an event string.