diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-03-19 15:38:06 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-03-19 18:23:44 -0600 |
commit | 4b88fb76efce8c436e63b907c9842345d4fa77c7 (patch) | |
tree | 67d8be3146bf0c32e93bd8209c141ed72c5a0ae2 /dump.c | |
parent | 27d6c58a7e12243bef66c58b38e7d1415d9ca07e (diff) | |
download | perl-4b88fb76efce8c436e63b907c9842345d4fa77c7.tar.gz |
Use the new utf8 to code point functions
These functions should be used in preference to the old ones which can
read beyond the end of the input string.
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -281,7 +281,7 @@ Perl_pv_escape( pTHX_ SV *dsv, char const * const str, isuni = 1; for ( ; (pv < end && (!max || (wrote < max))) ; pv += readsize ) { - const UV u= (isuni) ? utf8_to_uvchr((U8*)pv, &readsize) : (U8)*pv; + const UV u= (isuni) ? utf8_to_uvchr_buf((U8*)pv, (U8*) end, &readsize) : (U8)*pv; const U8 c = (U8)u & 0xFF; if ( ( u > 255 ) @@ -2420,7 +2420,7 @@ Perl_sv_catxmlpvn(pTHX_ SV *dsv, const char *pv, STRLEN len, int utf8) retry: while (pv < e) { if (utf8) { - c = utf8_to_uvchr((U8*)pv, &cl); + c = utf8_to_uvchr_buf((U8*)pv, (U8*)e, &cl); if (cl == 0) { SvCUR(dsv) = dsvcur; pv = start; |