1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-22 16:20:23 +02:00

40260: zero new space allocated in prompt buffer

This commit is contained in:
Paulo Andrade 2017-01-03 12:29:34 +01:00 committed by Peter Stephenson
parent 4fb4ce190c
commit 8d4c98540d
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2017-01-03 Peter Stephenson <p.stephenson@samsung.com>
* Paulo Andrade: 40260: Src/prompt.c: Set newly allocated
space in prompt buffer to zero as it may be tested.
2016-12-28 Sebastian Gniazdowski <psprint@fastmail.com>
* 40231: Src/params.c: Optimise setarrvalue().

View file

@ -920,6 +920,7 @@ addbufspc(int need)
if(need & 255)
need = (need | 255) + 1;
bv->buf = realloc(bv->buf, bv->bufspc += need);
memset(bv->buf + bv->bufspc - need, 0, need);
bv->bp = bv->buf + bo;
if(bo1 != -1)
bv->bp1 = bv->buf + bo1;