Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -642,14 +642,24 @@ fromBuffer: [str cString]]; } - (size_t)writeLine: (OFString*)str { - size_t ret = [self writeString: str]; - [self writeInt8: '\n']; + size_t len = [str cStringLength]; + char *buf; + + buf = [self allocMemoryWithSize: len + 1]; + + @try { + memcpy(buf, [str cString], len); + buf[len] = '\n'; - return ret + 1; + return [self writeNBytes: len + 1 + fromBuffer: buf]; + } @finally { + [self freeMemory: buf]; + } } - (size_t)writeFormat: (OFString*)fmt, ... { va_list args;