diff options
author | ZyX <kp-pav@yandex.ru> | 2018-01-03 00:00:16 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2018-01-14 01:33:16 +0300 |
commit | 9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3 (patch) | |
tree | 8d7fd11beeb2a300bd21f997e3fdca5b4f29382e /src/nvim/ex_cmds2.c | |
parent | 9ddeb6e187e6ef6045bf037e4225dc46c8efb693 (diff) | |
download | rneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.tar.gz rneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.tar.bz2 rneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.zip |
*: Provide list length when allocating lists
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index ec4ce63e17..28b021d4e4 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -3758,7 +3758,7 @@ static void script_host_execute(char *name, exarg_T *eap) char *const script = script_get(eap, &len); if (script != NULL) { - list_T *const args = tv_list_alloc(); + list_T *const args = tv_list_alloc(3); // script tv_list_append_allocated_string(args, script); // current range @@ -3773,7 +3773,7 @@ static void script_host_execute_file(char *name, exarg_T *eap) uint8_t buffer[MAXPATHL]; vim_FullName((char *)eap->arg, (char *)buffer, sizeof(buffer), false); - list_T *args = tv_list_alloc(); + list_T *args = tv_list_alloc(3); // filename tv_list_append_string(args, (const char *)buffer, -1); // current range @@ -3784,7 +3784,7 @@ static void script_host_execute_file(char *name, exarg_T *eap) static void script_host_do_range(char *name, exarg_T *eap) { - list_T *args = tv_list_alloc(); + list_T *args = tv_list_alloc(3); tv_list_append_number(args, (int)eap->line1); tv_list_append_number(args, (int)eap->line2); tv_list_append_string(args, (const char *)eap->arg, -1); |