fix recursion depth: cstring algorithm