I was going to suggest `input[strcspn(input, "<>")] != '\0'` as an alternative that just does one pass through the string; however, in real world usage I think the first `strchr` will find a '<' almost 100% of the time, so the existing implementation is probably better.