aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/garray.h
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-06-09 00:02:50 -0300
committerJustin M. Keyes <justinkz@gmail.com>2014-06-30 03:57:50 -0400
commitbe3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad (patch)
tree60615f7476a791a1e57deaafa414585bd802898f /src/nvim/garray.h
parentd723e7fd61d48b037a2b8360162efa1cddad64d2 (diff)
downloadrneovim-be3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad.tar.gz
rneovim-be3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad.tar.bz2
rneovim-be3a4b6ca81c4e9dd3faa81dc01f53468ceed3ad.zip
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
Diffstat (limited to 'src/nvim/garray.h')
-rw-r--r--src/nvim/garray.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/garray.h b/src/nvim/garray.h
index 6e440039dd..df5740c553 100644
--- a/src/nvim/garray.h
+++ b/src/nvim/garray.h
@@ -12,7 +12,7 @@ typedef struct growarray {
void *ga_data; // pointer to the first item
} garray_T;
-#define GA_EMPTY_INIT_VALUE { 0, 0, 0, 0, NULL }
+#define GA_EMPTY_INIT_VALUE { 0, 0, 0, 1, NULL }
#define GA_EMPTY(ga_ptr) ((ga_ptr)->ga_len <= 0)