ObjFW  Diff

Differences From Artifact [77f3cb0a9b]:

To Artifact [5a1ab363d9]:


640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660


661
662
663
664
665
666
667
{
	return [self writeNBytes: [str cStringLength]
		      fromBuffer: [str cString]];
}

- (size_t)writeLine: (OFString*)str
{
	size_t len = [str cStringLength];
	char *buf;

	buf = [self allocMemoryWithSize: len + 1];

	@try {
		memcpy(buf, [str cString], len);
		buf[len] = '\n';

		return [self writeNBytes: len + 1
			      fromBuffer: buf];
	} @finally {
		[self freeMemory: buf];
	}


}

- (size_t)writeFormat: (OFString*)fmt, ...
{
	va_list args;
	size_t ret;








|








|
|



>
>







640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
{
	return [self writeNBytes: [str cStringLength]
		      fromBuffer: [str cString]];
}

- (size_t)writeLine: (OFString*)str
{
	size_t ret, len = [str cStringLength];
	char *buf;

	buf = [self allocMemoryWithSize: len + 1];

	@try {
		memcpy(buf, [str cString], len);
		buf[len] = '\n';

		ret = [self writeNBytes: len + 1
			     fromBuffer: buf];
	} @finally {
		[self freeMemory: buf];
	}

	return ret;
}

- (size_t)writeFormat: (OFString*)fmt, ...
{
	va_list args;
	size_t ret;