fix unsafe string manipulation, XCode 4.5 treats it as error