Differences From Artifact [b1e5dbc875]:
- File src/OFString.m — part of check-in [441e5ec29b] at 2009-05-03 14:20:49 on branch trunk — Fix wrong free in OFString. Should be [self freeMem:]. (user: js, size: 9227) [annotate] [blame] [check-ins using]
To Artifact [0c1768f337]:
- File
src/OFString.m
— part of check-in
[1b7a52cdf5]
at
2009-05-03 14:59:32
on branch trunk
— Get rid of two unnecessary variables.
This works as resizeMem:toSize: throws an exception if there's not
enough memory and thus string isn't even set, so the string isn't even
touched and still correct. (user: js, size: 9168) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
316 317 318 319 320 321 322 | - append: (OFString*)str { return [self appendCString: [str cString]]; } - appendCString: (const char*)str { | < | < | < | | < | < | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - append: (OFString*)str { return [self appendCString: [str cString]]; } - appendCString: (const char*)str { size_t strlength; strlength = strlen(str); switch (check_utf8(str, strlength)) { case 1: is_utf8 = YES; break; case -1: @throw [OFInvalidEncodingException newWithClass: isa]; } string = [self resizeMem: string toSize: length + strlength + 1]; memcpy(string + length, str, strlength + 1); length += strlength; return self; } - appendWithFormatCString: (const char*)fmt, ... { id ret; |
︙ | ︙ |