Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -318,12 +318,11 @@ return [self appendCString: [str cString]]; } - appendCString: (const char*)str { - char *newstr; - size_t newlen, strlength; + size_t strlength; strlength = strlen(str); switch (check_utf8(str, strlength)) { case 1: @@ -331,18 +330,14 @@ break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } - newlen = length + strlength; - newstr = [self resizeMem: string - toSize: newlen + 1]; - - memcpy(newstr + length, str, strlength + 1); - - length = newlen; - string = newstr; + string = [self resizeMem: string + toSize: length + strlength + 1]; + memcpy(string + length, str, strlength + 1); + length += strlength; return self; } - appendWithFormatCString: (const char*)fmt, ...