From: Bernd Edlinger Date: Thu, 2 Oct 2014 00:06:28 +0000 (+0000) Subject: charset.c (convert_no_conversion): Reallocate memory with 25% headroom. X-Git-Tag: releases/gcc-5.1.0~4341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc257367bbfc33a9b6d57bf5a33cd042b56403cf;p=thirdparty%2Fgcc.git charset.c (convert_no_conversion): Reallocate memory with 25% headroom. 2014-10-02 Bernd Edlinger Jeff Law * charset.c (convert_no_conversion): Reallocate memory with 25% headroom. Co-Authored-By: Jeff Law From-SVN: r215785 --- diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 4ad851e705e9..3b23708d39ae 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2014-10-02 Bernd Edlinger + Jeff Law + + * charset.c (convert_no_conversion): Reallocate memory with 25% + headroom. + 2014-10-01 Edward Smith-Rowland <3dw4rd@verizon.net> Implement SD-6: SG10 Feature Test Recommendations diff --git a/libcpp/charset.c b/libcpp/charset.c index b766eec8b220..1064f5276332 100644 --- a/libcpp/charset.c +++ b/libcpp/charset.c @@ -537,6 +537,7 @@ convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED, if (to->len + flen > to->asize) { to->asize = to->len + flen; + to->asize += to->asize / 4; to->text = XRESIZEVEC (uchar, to->text, to->asize); } memcpy (to->text + to->len, from, flen);