ObjFW  Diff

Differences From Artifact [c1cbc7f938]:

To Artifact [87992a22fc]:


51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
		@throw [OFOutOfMemoryException newWithClass: isa
					      requestedSize: sizeof(*ivars)];
	memset(ivars, 0, sizeof(*ivars));

	ivars->cString = (char*)s;
	ivars->cStringLength = initialized;

	switch (of_string_check_utf8(ivars->cString, ivars->cStringLength)) {

	case 1:
		ivars->isUTF8 = YES;
		break;
	case -1:
		free(ivars);
		@throw [OFInvalidEncodingException newWithClass: isa];
	}







|
>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
		@throw [OFOutOfMemoryException newWithClass: isa
					      requestedSize: sizeof(*ivars)];
	memset(ivars, 0, sizeof(*ivars));

	ivars->cString = (char*)s;
	ivars->cStringLength = initialized;

	switch (of_string_check_utf8(ivars->cString, ivars->cStringLength,
	    &ivars->length)) {
	case 1:
		ivars->isUTF8 = YES;
		break;
	case -1:
		free(ivars);
		@throw [OFInvalidEncodingException newWithClass: isa];
	}