Replaced NSMutableString with c-loop and initWithBytesNoCopy:length:encoding:freeWhenDone