ObjFW  Check-in [607c862411]

Overview
Comment:Fix -[OFMutableString_UTF8 replaceCharactersInRange:withString:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 607c8624113339dd6fc3e484ef1d90515ad76c1dc04c8b53c91e65cd8b67d124
User & Date: js on 2012-01-31 14:32:31
Other Links: manifest | tags
Context
2012-01-31
15:16
Remove useless checks. check-in: f68b3b300d user: js tags: trunk
14:32
Fix -[OFMutableString_UTF8 replaceCharactersInRange:withString:]. check-in: 607c862411 user: js tags: trunk
13:59
Add -[removeAllObjects] and -[removeAllItems]. check-in: d1572ef036 user: js tags: trunk
Changes

Modified src/OFMutableString_UTF8.m from [a5af572702] to [5552cd8f9b].

531
532
533
534
535
536
537
538
539


540
541
542
543
544
545
546
531
532
533
534
535
536
537


538
539
540
541
542
543
544
545
546







-
-
+
+








	newCStringLength = s->cStringLength - (end - start) +
	    [replacement UTF8StringLength];
	s->hashed = NO;
	s->cString = [self resizeMemory: s->cString
				 toSize: newCStringLength + 1];

	memmove(s->cString + end, s->cString + start +
	    [replacement UTF8StringLength], s->cStringLength - end);
	memmove(s->cString + start + [replacement UTF8StringLength],
	    s->cString + end, s->cStringLength - end);
	memcpy(s->cString + start, [replacement UTF8String],
	    [replacement UTF8StringLength]);
	s->cString[newCStringLength] = '\0';

	s->cStringLength = newCStringLength;
	s->length = newLength;
}