ObjFW  Diff

Differences From Artifact [7c3c0e4a34]:

To Artifact [d10ff12b41]:


34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48







-
+







			length = i;

	return [OFString stringWithUTF8String: buffer
				       length: length];
}

static uintmax_t
octalValueFromBuffer(const char *buffer, size_t length, size_t max)
octalValueFromBuffer(const char *buffer, size_t length, uintmax_t max)
{
	uintmax_t value = [stringFromBuffer(buffer, length) octalValue];

	if (value > max)
		@throw [OFOutOfRangeException exception];

	return value;
143
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
143
144
145
146
147
148
149

150
151
152
153
154
155
156
157
158







-
+








		[_stream readIntoBuffer: buffer
			    exactLength: 512];
		_toRead -= 512;
	}

	if (_toRead > 0) {
		[_stream readIntoBuffer: buffer
			    exactLength: _toRead];
			    exactLength: (size_t)_toRead];
		_toRead = 0;
	}

	if (_size % 512 != 0)
		[_stream readIntoBuffer: buffer
			    exactLength: 512 - (_size % 512)];
}
@end