Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -56,22 +56,21 @@ resourcesep = [str indexOfFirstOccurrenceOfString: @"/"]; if (nodesep == SIZE_MAX) [self setNode: nil]; else - [self setNode: [str substringFromIndex: 0 - toIndex: nodesep]]; + [self setNode: [str substringWithRange: of_range(0, nodesep)]]; if (resourcesep == SIZE_MAX) { [self setResource: nil]; resourcesep = [str length]; } else - [self setResource: [str substringFromIndex: resourcesep + 1 - toIndex: [str length]]]; + [self setResource: [str substringWithRange: + of_range(resourcesep + 1, [str length] - resourcesep - 1)]]; - [self setDomain: [str substringFromIndex: nodesep + 1 - toIndex: resourcesep]]; + [self setDomain: [str substringWithRange: + of_range(nodesep + 1, resourcesep - nodesep - 1)]]; return self; } - (void)dealloc Index: src/XMPPSCRAMAuth.m ================================================================== --- src/XMPPSCRAMAuth.m +++ src/XMPPSCRAMAuth.m @@ -182,12 +182,12 @@ [challenge itemSize]]; enumerator = [[chal componentsSeparatedByString: @","] objectEnumerator]; while ((comp = [enumerator nextObject]) != nil) { - OFString *entry = [comp substringFromIndex: 2 - toIndex: [comp length]]; + OFString *entry = [comp substringWithRange: + of_range(2, [comp length] - 2)]; if ([comp hasPrefix: @"r="]) { if (![entry hasPrefix: cNonce]) @throw [XMPPAuthFailedException newWithClass: isa @@ -331,12 +331,12 @@ { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *mess = [OFString stringWithCString: [message cArray] length: [message count] * [message itemSize]]; - OFString *value = [mess substringFromIndex: 2 - toIndex: [mess length]]; + OFString *value = [mess substringWithRange: + of_range(2, [mess length] - 2)]; if ([mess hasPrefix: @"v="]) { if (![value isEqual: [serverSignature stringByBase64Encoding]]) @throw [XMPPAuthFailedException newWithClass: isa