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/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 8390efe979..9f9c9c279c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7499,7 +7499,7 @@ typedef struct { int to; } langmap_entry_T; -static garray_T langmap_mapga; +static garray_T langmap_mapga = GA_EMPTY_INIT_VALUE; /* * Search for an entry in "langmap_mapga" for "from". If found set the "to" -- cgit