limit strchr checking until original string length