summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-03 20:57:19 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-03 20:57:19 +0000
commitad391ad9bbfeaf73d3944b50240313a5677bcc60 (patch)
tree270b2e4acd993a5e6c9721113cd4130e6ca64f4e /regcomp.c
parent801ca9cd5af7c86da741a601b4721bff3f94f9cd (diff)
downloadperl-ad391ad9bbfeaf73d3944b50240313a5677bcc60.tar.gz
Make uv_to_utf8() to zero-terminate its output buffer,
always use (at least) UTF8_MAXLEN + 1 U8s deep buffer. p4raw-id: //depot/perl@7967
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/regcomp.c b/regcomp.c
index 3b4f481b1c..cf100d7ece 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4029,13 +4029,7 @@ STATIC void
S_reguni(pTHX_ RExC_state_t *pRExC_state, UV uv, char* s, STRLEN* lenp)
{
dTHR;
- if (SIZE_ONLY) {
- U8 tmpbuf[UTF8_MAXLEN];
- *lenp = uv_to_utf8(tmpbuf, uv) - tmpbuf;
- }
- else
- *lenp = uv_to_utf8((U8*)s, uv) - (U8*)s;
-
+ *lenp = SIZE_ONLY ? UNISKIP(uv) : (uv_to_utf8((U8*)s, uv) - (U8*)s);
}
/*