File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -516,21 +516,14 @@ S_is_utf8_overlong(const U8 * const s, const STRLEN len)
516
516
#endif
517
517
518
518
case 0xF0 :
519
- return (len < 2 )
520
- ? -1
521
- : NATIVE_UTF8_TO_I8 (s [1 ]) < UTF_MIN_CONTINUATION_BYTE + 0x10 ;
522
519
case 0xF8 :
523
- return (len < 2 )
524
- ? -1
525
- : NATIVE_UTF8_TO_I8 (s [1 ]) < UTF_MIN_CONTINUATION_BYTE + 0x08 ;
526
520
case 0xFC :
527
- return (len < 2 )
528
- ? -1
529
- : NATIVE_UTF8_TO_I8 (s [1 ]) < UTF_MIN_CONTINUATION_BYTE + 0x04 ;
530
521
case 0xFE :
531
522
return (len < 2 )
532
- ? -1
533
- : NATIVE_UTF8_TO_I8 (s [1 ]) < UTF_MIN_CONTINUATION_BYTE + 0x02 ;
523
+ ? -1 /* This pattern encapsulates
524
+ * F0 => 0x10; F8 => 0x08; FC => 0x04; FF => 0x02 */
525
+ : NATIVE_UTF8_TO_I8 (s [1 ]) < UTF_MIN_CONTINUATION_BYTE
526
+ + 0x100 - NATIVE_UTF8_TO_I8 (s [0 ]);
534
527
case 0xFF :
535
528
return isFF_overlong (s , len );
536
529
}
You can’t perform that action at this time.
0 commit comments