diff options
author | Karl Williamson <khw@cpan.org> | 2016-11-06 02:05:41 +0100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-11-06 02:07:35 +0100 |
commit | bb93890c7f6776cf9d28935e93153fe3c3cbb064 (patch) | |
tree | 0f42322a42ab3c36433cc1219b0888d3fb160e3a /utf8.c | |
parent | 86db16b80af61d0f0d083707c76bef013130caa7 (diff) | |
download | perl-bb93890c7f6776cf9d28935e93153fe3c3cbb064.tar.gz |
utf8.c: No need to look at trailing NUL in comparing string
I meant to get this into commit
b0b342d4b3fa61880a96b645a3dab648f7c4c682, but didn't. Subtract 1 from
the sizeof a constant string to get the number of bytes to compare, as
we don't need to look at the trailing NUL.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -452,7 +452,7 @@ S_does_utf8_overflow(const U8 * const s, const U8 * e) if (isFF_OVERLONG(s, e - s)) { const U8 max_32_bit_overlong[] = "\xFF\x80\x80\x80\x80\x80\x80\x84"; return memGE(s, max_32_bit_overlong, - MIN(e - s, sizeof(max_32_bit_overlong))); + MIN(e - s, sizeof(max_32_bit_overlong) - 1)); } #endif |