diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-01-29 10:41:14 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-01-29 13:58:12 -0700 |
commit | ea4d335b445aa246c7b9e4d60a6983bb23108fc0 (patch) | |
tree | bbbcd2755c44a11a758852e95f920bd6d6923e0f /pp.c | |
parent | 628253b8ba8b9cbebcf85ac3826fb6d8fdeb166a (diff) | |
download | perl-ea4d335b445aa246c7b9e4d60a6983bb23108fc0.tar.gz |
pp.c: Can grow scalar by less
The max expansion when a Latin1 character is folded and converted to
UTF-8 is '2' bytes per input byte, not the more general case.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4218,7 +4218,9 @@ PP(pp_fc) SvCUR_set(dest, len); len = sv_utf8_upgrade_flags_grow(dest, SV_GMAGIC|SV_FORCE_UTF8_UPGRADE, - (send -s) * UTF8_MAX_FOLD_CHAR_EXPAND + 1); + /* The max expansion for latin1 + * chars is 1 byte becomes 2 */ + (send -s) * 2 + 1); d = (U8*)SvPVX(dest) + len; CAT_UNI_TO_UTF8_TWO_BYTE(d, GREEK_SMALL_LETTER_MU); |