From dad2fc10b88c86465b43d9e65bf9d1ab2dd4aa13 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Mon, 12 Sep 2011 23:17:00 +0000 Subject: [PATCH] Adjust to recent ObjFW changes. FossilOrigin-Name: 88eea97f3d869fb6bfd245c629c1871a30695be78d65754ce1679819a3b178fa --- src/IRCUser.h | 4 ++-- src/IRCUser.m | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/IRCUser.h b/src/IRCUser.h index 08c8306..936194f 100644 --- a/src/IRCUser.h +++ b/src/IRCUser.h @@ -31,6 +31,6 @@ @property (copy, readonly) OFString *nickname, *username, *hostname; -+ IRCUserWithString: (OFString*)str; -- initWithString: (OFString*)str; ++ IRCUserWithString: (OFString*)string; +- initWithString: (OFString*)string; @end diff --git a/src/IRCUser.m b/src/IRCUser.m index 557a84c..3718ac8 100644 --- a/src/IRCUser.m +++ b/src/IRCUser.m @@ -32,12 +32,12 @@ @implementation IRCUser @synthesize username, nickname, hostname; -+ IRCUserWithString: (OFString*)str ++ IRCUserWithString: (OFString*)string { - return [[[self alloc] initWithString: str] autorelease]; + return [[[self alloc] initWithString: string] autorelease]; } -- initWithString: (OFString*)str +- initWithString: (OFString*)string { char *tmp2 = NULL; @@ -46,24 +46,24 @@ @try { char *tmp; - if ((tmp2 = strdup(str.cString)) == NULL) + if ((tmp2 = strdup([string UTF8String])) == NULL) @throw [OFOutOfMemoryException newWithClass: isa - requestedSize: str.cStringLength]; + requestedSize: [string UTF8StringLength]]; if ((tmp = strchr(tmp2, '@')) == NULL) @throw [OFInvalidFormatException newWithClass: isa]; *tmp = '\0'; - hostname = [[OFString alloc] initWithCString: tmp + 1]; + hostname = [[OFString alloc] initWithUTF8String: tmp + 1]; if ((tmp = strchr(tmp2, '!')) == NULL) @throw [OFInvalidFormatException newWithClass: isa]; *tmp = '\0'; - username = [[OFString alloc] initWithCString: tmp + 1]; + username = [[OFString alloc] initWithUTF8String: tmp + 1]; - nickname = [[OFString alloc] initWithCString: tmp2]; + nickname = [[OFString alloc] initWithUTF8String: tmp2]; } @catch (id e) { [self release]; @throw e;