summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-19 07:23:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-19 07:23:48 +0000
commitaa6ffa1650ac66b040000b508f9d85569d9fe839 (patch)
treebc3ba59b6b3e601f5392b6be8dd6c8af590c5d9e /pp.c
parent4673fc70de29ec9782a54acc86b498189e02a8e2 (diff)
downloadperl-aa6ffa1650ac66b040000b508f9d85569d9fe839.tar.gz
allocate sufficient buffer sizes for 64-bit wide utf8 characters
permitted by change#5011 (from Gisle Aas) p4raw-link: @5011 on //depot/perl: 3c77ea2bace63b1ad27d15a6366cb938bdd158cb p4raw-id: //depot/perl@5136
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index eb0522878d..0b057644f9 100644
--- a/pp.c
+++ b/pp.c
@@ -2202,13 +2202,13 @@ PP(pp_chr)
(void)SvUPGRADE(TARG,SVt_PV);
if (value > 255 && !IN_BYTE) {
- SvGROW(TARG,8);
+ SvGROW(TARG, UTF8_MAXLEN+1);
tmps = SvPVX(TARG);
tmps = (char*)uv_to_utf8((U8*)tmps, (UV)value);
SvCUR_set(TARG, tmps - SvPVX(TARG));
*tmps = '\0';
- SvUTF8_on(TARG);
(void)SvPOK_only(TARG);
+ SvUTF8_on(TARG);
XPUSHs(TARG);
RETURN;
}