ObjFW  Check-in [3a1cd610ed]

Overview
Comment:Don't free ret in -[unicodeString] as it is autoreleased now.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3a1cd610ed3dc1882209805a41fb682685e672a7095de7de8bf105834af3f2ad
User & Date: js on 2011-05-02 13:01:59
Other Links: manifest | tags
Context
2011-05-02
20:46
Add +[OFString stringWithUnicodeString:length:]. check-in: 04ffb67949 user: js tags: trunk
13:01
Don't free ret in -[unicodeString] as it is autoreleased now. check-in: 3a1cd610ed user: js tags: trunk
2011-05-01
23:58
Autorelease the return value of -[unicodeString] and include a BOM. check-in: 7b7250a0ba user: js tags: trunk
Changes

Modified src/OFString.m from [fb7ee6732e] to [b56b81b94d].

1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609

	while (i < length) {
		of_unichar_t c;
		size_t cLen;

		cLen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (cLen == 0 || c > 0x10FFFF) {
			free(ret);
			@throw [OFInvalidEncodingException newWithClass: isa];
		}

		ret[j++] = c;
		i += cLen;
	}

	ret[j] = 0;








|
<

<







1592
1593
1594
1595
1596
1597
1598
1599

1600

1601
1602
1603
1604
1605
1606
1607

	while (i < length) {
		of_unichar_t c;
		size_t cLen;

		cLen = of_string_utf8_to_unicode(string + i, length - i, &c);

		if (cLen == 0 || c > 0x10FFFF)

			@throw [OFInvalidEncodingException newWithClass: isa];


		ret[j++] = c;
		i += cLen;
	}

	ret[j] = 0;