diff options
author | Karl Williamson <khw@cpan.org> | 2021-05-16 13:15:56 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-05-29 06:04:10 -0600 |
commit | 0b47b39244b67fe19dc971903ce28a7a637c2a9a (patch) | |
tree | 380e57f81af386a4d5b20f6c4321a1ef9e67502b /utf8.h | |
parent | fbfa0c9e6e0b2a3aa0ce844f02e82eb217cbddc6 (diff) | |
download | perl-0b47b39244b67fe19dc971903ce28a7a637c2a9a.tar.gz |
UTF8_IS_NEXT_CHAR_DOWNGRADEABLE() check before deref
Reorder the clauses to check first before dereferencing
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -474,8 +474,8 @@ uppercase/lowercase/titlecase/fold into. /* This works in the face of malformed UTF-8. */ #define UTF8_IS_NEXT_CHAR_DOWNGRADEABLE(s, e) \ - ( UTF8_IS_DOWNGRADEABLE_START(*(s)) \ - && ( (e) - (s) > 1) \ + ( ( (e) - (s) > 1) \ + && UTF8_IS_DOWNGRADEABLE_START(*(s)) \ && UTF8_IS_CONTINUATION(*((s)+1))) /* Number of bytes a code point occupies in UTF-8. */ |