fix wrong strchr usage