@@ -56,11 +56,11 @@ { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; sock = [[OFTCPSocket alloc] init]; [sock connectToHost: server - onPort: port]; + port: port]; [self sendLineWithFormat: @"NICK %@", nickname]; [self sendLineWithFormat: @"USER %@ * 0 :%@", username, realname]; [pool release]; @@ -108,11 +108,11 @@ didSendLine: line]; [sock writeLine: line]; } -- (void)sendLineWithFormat: (OFString*)format, ... +- (void)sendLineWithFormat: (OFConstantString*)format, ... { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *line; va_list args; @@ -178,14 +178,14 @@ OFString *who = [splitted objectAtIndex: 0]; OFString *where = [splitted objectAtIndex: 2]; IRCUser *user; IRCChannel *channel; - who = [who substringFromIndex: 1 - toIndex: who.length]; - where = [where substringFromIndex: 1 - toIndex: where.length]; + who = [who substringWithRange: + of_range(1, who.length - 1)]; + where = [where substringWithRange: + of_range(1, where.length - 1)]; user = [IRCUser IRCUserWithString: who]; if ([who hasPrefix: [nickname stringByAppendingString: @"!"]]) { @@ -213,14 +213,14 @@ OFString *msg; size_t pos = from.length + 1 + [[splitted objectAtIndex: 1] length] + 1 + to.length; - from = [from substringFromIndex: 1 - toIndex: from.length]; - msg = [line substringFromIndex: pos + 2 - toIndex: line.length]; + from = [from substringWithRange: + of_range(1, from.length - 1)]; + msg = [line substringWithRange: + of_range(pos + 2, line.length - pos - 2)]; user = [IRCUser IRCUserWithString: from]; if (![to isEqual: nickname]) { IRCChannel *channel;