diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-19 04:44:41 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-19 04:44:41 +0000 |
commit | 98b27f730135d66291d417127f64dc5e94d47ae3 (patch) | |
tree | ce62c2a03ef833c6ea5bb451d95c25eb5dcc8f0c /pp.c | |
parent | bbee22da22fa5dec68cc0a214906c852df8ebcc0 (diff) | |
download | perl-98b27f730135d66291d417127f64dc5e94d47ae3.tar.gz |
Let's not overdo the growth.
p4raw-id: //depot/perl@14764
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3350,8 +3350,10 @@ PP(pp_uc) SETs(TARG); } else { + STRLEN nchar = utf8_length(s, s + len); + (void)SvUPGRADE(TARG, SVt_PV); - SvGROW(TARG, (len * UTF8_MAXLEN_UCLC) + 1); + SvGROW(TARG, (nchar * UTF8_MAXLEN_UCLC) + 1); (void)SvPOK_only(TARG); d = (U8*)SvPVX(TARG); send = s + len; @@ -3417,8 +3419,10 @@ PP(pp_lc) SETs(TARG); } else { + STRLEN nchar = utf8_length(s, s + len); + (void)SvUPGRADE(TARG, SVt_PV); - SvGROW(TARG, (len * UTF8_MAXLEN_UCLC) + 1); + SvGROW(TARG, (nchar * UTF8_MAXLEN_UCLC) + 1); (void)SvPOK_only(TARG); d = (U8*)SvPVX(TARG); send = s + len; |