@@ -119,15 +119,16 @@ @end @implementation OFINICategory @synthesize name = _name; -- (instancetype)of_init +- (instancetype)of_initWithName: (OFString *)name { self = [super init]; @try { + _name = [name copy]; _lines = [[OFMutableArray alloc] init]; } @catch (id e) { [self release]; @throw e; } @@ -507,17 +508,17 @@ [stream writeFormat: @"%@\r\n", comment->_comment]; } else if ([line isKindOfClass: [OFINICategory_Pair class]]) { OFINICategory_Pair *pair = line; OFString *key = escapeString(pair->_key); OFString *value = escapeString(pair->_value); - OFString *line = [OFString + OFString *tmp = [OFString stringWithFormat: @"%@=%@\r\n", key, value]; - [stream writeString: line + [stream writeString: tmp encoding: encoding]; } else @throw [OFInvalidArgumentException exception]; } return true; } @end