ObjFW  Diff

Differences From Artifact [39a9726c51]:

To Artifact [b4559a9fab]:


521
522
523
524
525
526
527



528
529
530
531
532
533
534
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537







+
+
+







{
	void *pool = objc_autoreleasePoolPush(), *pool2;
	const of_unichar_t *characters;
	const of_unichar_t *searchCharacters = [string characters];
	size_t searchLength = [string length];
	size_t replacementLength = [replacement length];

	if (string == nil || replacement == nil)
		@throw [OFInvalidArgumentException exception];

	if (range.length > SIZE_MAX - range.location ||
	    range.location + range.length > [self length])
		@throw [OFOutOfRangeException exception];

	if (searchLength > range.length) {
		objc_autoreleasePoolPop(pool);
		return;