ObjFW  Diff

Differences From Artifact [845a3454e0]:

To Artifact [37b9bc8f4c]:


173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
}

- appendCString: (const char*)str
{
	char   *newstr;
	size_t newlen, strlength;

	if (string == NULL) 
		return [self setTo: [OFString newFromCString: str]];

	strlength = strlen(str);

	switch (check_utf8(str, strlength)) {
	case 1:
		is_utf8 = YES;







|







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
}

- appendCString: (const char*)str
{
	char   *newstr;
	size_t newlen, strlength;

	if (string == NULL)
		return [self setTo: [OFString newFromCString: str]];

	strlength = strlen(str);

	switch (check_utf8(str, strlength)) {
	case 1:
		is_utf8 = YES;
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
- upper
{
	size_t i = length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithObject: self];

	while (i--) 
		string[i] = toupper(string[i]);

	return self;
}

- lower
{
	size_t i = length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithObject: self];

	while (i--) 
		string[i] = tolower(string[i]);

	return self;
}
@end







|












|





296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
- upper
{
	size_t i = length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithObject: self];

	while (i--)
		string[i] = toupper(string[i]);

	return self;
}

- lower
{
	size_t i = length;

	if (is_utf8)
		@throw [OFInvalidEncodingException newWithObject: self];

	while (i--)
		string[i] = tolower(string[i]);

	return self;
}
@end