@@ -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