2012-01-04 I just converted a similar C routine to the standard strchr(). Shortly afterwards, I discovered a bug: endless looping or seg- fault. It was likely related to the strchr() switch, but the code appeared to be fine. The man page strchr(3) wasn't talking about irregularities neither. It was surprising to me to find the following note to strchr() in POSIX: The terminating null byte is considered to be part of the string. [0] Of course, this explained the bug. But huh ... is this consistent? Well, likely it is, although it surprises. Seems I haven't understood the principles well enough yet. This is a starting point for a discussion on the idea of few, consistent rules vs. the principle of least surprise. [0] http://pubs.opengroup.org/onlinepubs/007904975/functions/strchr.html http://marmaro.de/lue/ markus schnalke