ObjFW  Check-in [d2b0beab38]

Overview
Comment:Don't send two packets in -[OFStream writeLine:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d2b0beab387d07ad5fe65b92908e74dcdf77d6357e752e316e80743df1370756
User & Date: js on 2011-01-22 23:35:14
Other Links: manifest | tags
Context
2011-01-22
23:53
Autodetect family in -[bindService:onNode:]. check-in: ca53d41c0f user: js tags: trunk
23:35
Don't send two packets in -[OFStream writeLine:]. check-in: d2b0beab38 user: js tags: trunk
2011-01-21
01:23
Remove variables $ENV_{CFLAGS,LIBS,LDFLAGS} in objfw-compile. check-in: ca9a6f1593 user: js tags: trunk
Changes

Modified src/OFStream.m from [515ee39e97] to [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;