don't call strchr() if not necessary