Added safe_copy_string.