ObjFW  Diff

Differences From Artifact [515ee39e97]:

To Artifact [c9c58ea96b]:


640
641
642
643
644
645
646


647

648



649
650




651
652
653
654
655
656
657
{
	return [self writeNBytes: [str cStringLength]
		      fromBuffer: [str cString]];
}

- (size_t)writeLine: (OFString*)str
{


	size_t ret = [self writeString: str];

	[self writeInt8: '\n'];




	return ret + 1;




}

- (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
{
	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;