From be3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Mon, 9 Jun 2014 00:02:50 -0300 Subject: ga_growsize should be >= 1 I know it could be 0 sometimes. Running the tests with `assert(gap->ga_growsize > 0)` in ga_grow() crashes nvim while running the tests. - Add a setter for ga_growsize that checks whether the value passed is >=1 (log in case it's not) - log when ga_grow() tries to use a ga_growsize that's not >=1 - use GA_EMPTY_INIT_VALUE is many places --- src/nvim/hardcopy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/hardcopy.c') diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index be6d8ee0ee..8db4c264b2 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -1285,7 +1285,7 @@ static int prt_collate; * Buffers used when generating PostScript output */ static char_u prt_line_buffer[257]; -static garray_T prt_ps_buffer; +static garray_T prt_ps_buffer = GA_EMPTY_INIT_VALUE; static int prt_do_conv; static vimconv_T prt_conv; -- cgit