Replaced strchr() usage with strchar_r()