summaryrefslogtreecommitdiff
path: root/utfebcdic.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-10-09 10:02:31 -0600
committerKarl Williamson <khw@cpan.org>2019-10-09 10:19:21 -0600
commitee0ff0f58536ba7975a4b8f1d21309ae9f451df7 (patch)
tree1fada1b5c31569d52adac373dbc55834de43c52a /utfebcdic.h
parenta281f16cacceabade4e75fbbbeb567285d462ba0 (diff)
downloadperl-ee0ff0f58536ba7975a4b8f1d21309ae9f451df7.tar.gz
Add UTF8_CHK_SKIP() macro
This is a safer version of UTF8SKIP for use when the input could be possibly malformed. It uses strnlen() to not read past a NUL in the input. Since Perl adds NULs to the end of SV's, this will likely prevent reading beyond the end of a buffer. A still safer version could be written that doesn't look for just a NUL, but any unexpected byte, and stops just before that. I suspect that is overkill, and since strnlen() can be very fast, I went with this approach instead. Nothing precludes adding another version that does this full checking
Diffstat (limited to 'utfebcdic.h')
0 files changed, 0 insertions, 0 deletions