ObjFW  Check-in [16db39752c]

Overview
Comment:+[stringWithCString:length:] requires a \0 at the end of the string.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 16db39752c0900e76a0f8b2f7445e03f135f97bbdcdba077103ee6b307b228f4
User & Date: js on 2009-09-15 14:17:56
Other Links: manifest | tags
Context
2009-09-16
16:22
Rework OFAutoreleasePool and remove now unnecessary hack from OFList. check-in: a99f512a4a user: js tags: trunk
2009-09-15
14:17
+[stringWithCString:length:] requires a \0 at the end of the string. check-in: 16db39752c user: js tags: trunk
2009-09-14
18:37
A few test framework improvements and migration of OFString tests. check-in: 138cb8f09a user: js tags: trunk
Changes

Modified src/OFXMLParser.m from [c146e3c2d9] to [3c38909dd1].

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
}

static OF_INLINE OFString*
parse_numeric_entity(const char *entity, size_t length)
{
	uint32_t c;
	size_t i;
	char buf[4];

	if (length == 1 || *entity != '#')
		return nil;

	c = 0;
	entity++;
	length--;







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
}

static OF_INLINE OFString*
parse_numeric_entity(const char *entity, size_t length)
{
	uint32_t c;
	size_t i;
	char buf[5];

	if (length == 1 || *entity != '#')
		return nil;

	c = 0;
	entity++;
	length--;
67
68
69
70
71
72
73

74
75
76
77
78
79
80
			else
				return nil;
		}
	}

	if ((i = of_string_unicode_to_utf8(c, buf)) == 0)
		return nil;


	return [OFString stringWithCString: buf
				    length: i];
}

@implementation OFXMLParser
+ xmlParser







>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
			else
				return nil;
		}
	}

	if ((i = of_string_unicode_to_utf8(c, buf)) == 0)
		return nil;
	buf[i] = 0;

	return [OFString stringWithCString: buf
				    length: i];
}

@implementation OFXMLParser
+ xmlParser