From: Benno Schulenberg Date: Sat, 20 Feb 2016 16:35:09 +0000 (+0000) Subject: Reducing an allocation to what is actually needed. X-Git-Tag: v2.5.3~25 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=acf19bde227f5cdfe0389a84419ae2250be761b1;p=nano.git Reducing an allocation to what is actually needed. This undoes the papering-over of the just-fixed bug. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5655 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 74c67136..78fcce05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ This fixes Savannah bug #47124 reported by Mike Frysinger. * src/files.c (input_tab): Parse a character in the correct buffer. This fixes Savannah bug #47199. + * src/prompt.c (do_statusbar_output): Reduce an allocation to what + is actually needed. This undoes the papering-over of above bug. 2016-02-18 Benno Schulenberg * src/search.c (do_replace_loop), src/text.c (do_int_spell_fix), diff --git a/src/prompt.c b/src/prompt.c index d2ddd1c3..9d5908d7 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -285,7 +285,7 @@ void do_statusbar_output(int *the_input, size_t input_len, continue; /* More dangerousness fun. =) */ - answer = charealloc(answer, answer_len + (char_buf_len * 2)); + answer = charealloc(answer, answer_len + char_buf_len + 1); assert(statusbar_x <= answer_len);