Shouldn't you also check for p[1] != 0 before p[1] != p[2], to catch the case where reply ends after the opening bracket?

This should be p[1] == 0, of course.

Reply via email to