from cloudwu's cstring