X-Git-Url: http://cgit.babelmonkeys.de/?p=mpdbot.git;a=blobdiff_plain;f=src%2FMPDConnection.m;h=be46f5cd5d7e37a8279fd7adf990ef7be0d17ece;hp=8c610aa2d58f0e203cc8dd1cebb9a2eba082aefc;hb=158d0939288e8a3abb6bee2fef1697fedeaaaceb;hpb=4119a69a36303a285f2c2472c53f3a0906889fc7 diff --git a/src/MPDConnection.m b/src/MPDConnection.m index 8c610aa..be46f5c 100644 --- a/src/MPDConnection.m +++ b/src/MPDConnection.m @@ -86,10 +86,10 @@ index = [answer indexOfFirstOccurrenceOfString: @":"]; if (index == OF_INVALID_INDEX) continue; - [response setObject: [answer substringFromIndex: index + 2 - toIndex: answer.length] - forKey: [answer substringFromIndex: 0 - toIndex: index]]; + [response setObject: [answer substringWithRange: + of_range(index + 2, answer.length - (index + 2))] + forKey: [answer + substringWithRange: of_range(0, index)]]; } return response;