summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-06-28 23:57:31 -0600
committerKarl Williamson <khw@cpan.org>2019-07-01 19:38:00 -0600
commit82651abe60a8c1ca1f9eb6aae0202ecfd34bfecf (patch)
treec6d1ca001a6040c9e60c9a3260ce8323a2d99985 /utf8.c
parent34b633732d69b4cd1ac2f7d38cbcb76fa2e2c7ca (diff)
downloadperl-82651abe60a8c1ca1f9eb6aae0202ecfd34bfecf.tar.gz
utf8_to_uvchr_buf() make behavior match docs
For well formed input, there is no change. But for malformed it wasn't returning the documented length when warnings were enabled, and not always the documented value when they were disabled. This is implemented as an inline function, called from both the macro and the Perl_ form. Devel::PPPort has sufficient tests for this.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 84db2f6aee..07e4df72dd 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2271,10 +2271,7 @@ Perl_utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
{
PERL_ARGS_ASSERT_UTF8_TO_UVCHR_BUF;
- assert(s < send);
-
- return utf8n_to_uvchr(s, send - s, retlen,
- ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY);
+ return _utf8_to_uvchr_buf(s, send, retlen);
}
/* This is marked as deprecated