"Elijah Newren via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > for (cp = name, bracket_depth = 0; *cp; cp++) { > - if (*cp == '{') > + if (*(cp+1) == '{' && (*cp == '@' || *cp == '^')) { > + cp++; > bracket_depth++; Checking cp[1] before even knowing if cp[0] is the end of the string (hence cp[1] is an out of bounds access) smells fishy. If it were something like ... if (cp[0] && strchr("@^", cp[0]) && cp[1] == '{') ... it may be a bit more palatable, perhaps? At least writing it this way we can easily scale when we find the third character we need to special case, hopefully, but again, I do prefer if we can find a solution that does not have such an intimate knowledge about "@^", which I just failed to do here X-<. Thanks.