File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -1368,13 +1368,7 @@ - (int)diff_digit16:(unichar)c
13681368
13691369- (NSString *)diff_decodeURIWithText : (NSString *)percentEncoded
13701370{
1371- NSInteger inputLength = [percentEncoded length ];
1372-
1373- if (0 == inputLength) {
1374- return @" " ;
1375- }
1376-
1377- unichar decoded[inputLength];
1371+ unichar decoded[[percentEncoded length ]];
13781372 NSInteger input = 0 ;
13791373 NSInteger output = 0 ;
13801374
@@ -1388,10 +1382,6 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
13881382 continue ;
13891383 }
13901384
1391- if (inputLength < input + 3 ) {
1392- return nil ;
1393- }
1394-
13951385 int byte1 = ([self diff_digit16: [percentEncoded characterAtIndex: (input+1 )]] << 4 ) +
13961386 [self diff_digit16: [percentEncoded characterAtIndex: (input+2 )]];
13971387
@@ -1401,7 +1391,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
14011391 continue ;
14021392 }
14031393
1404- if (inputLength < input + 6 || ' %' != [percentEncoded characterAtIndex: (input + 3 )]) {
1394+ if (' %' != [percentEncoded characterAtIndex: (input + 3 )]) {
14051395 return nil ;
14061396 }
14071397
@@ -1420,7 +1410,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
14201410 continue ;
14211411 }
14221412
1423- if (inputLength < input + 9 || ' %' != [percentEncoded characterAtIndex: (input + 6 )]) {
1413+ if (' %' != [percentEncoded characterAtIndex: (input + 6 )]) {
14241414 return nil ;
14251415 }
14261416
@@ -1439,7 +1429,7 @@ - (NSString *)diff_decodeURIWithText:(NSString *)percentEncoded
14391429 continue ;
14401430 }
14411431
1442- if (inputLength < input + 12 || ' %' != [percentEncoded characterAtIndex: (input + 9 )]) {
1432+ if (' %' != [percentEncoded characterAtIndex: (input + 9 )]) {
14431433 return nil ;
14441434 }
14451435
You can’t perform that action at this time.
0 commit comments