diff options
author | Wayne Rowcliffe <war1025@gmail.com> | 2014-07-19 22:49:56 -0500 |
---|---|---|
committer | Wayne Rowcliffe <war1025@gmail.com> | 2014-07-22 05:28:17 -0500 |
commit | 9453b7230b68eef6a13403a124a288e9f95591cd (patch) | |
tree | 693aa9dbf43b3567de31763198596696bcd9e59d /src/nvim/tempfile.c | |
parent | 845d1bfa905cf0d28d9a1a662e42525449dd1be4 (diff) | |
download | rneovim-9453b7230b68eef6a13403a124a288e9f95591cd.tar.gz rneovim-9453b7230b68eef6a13403a124a288e9f95591cd.tar.bz2 rneovim-9453b7230b68eef6a13403a124a288e9f95591cd.zip |
Statically allocate NameBuff
Diffstat (limited to 'src/nvim/tempfile.c')
-rw-r--r-- | src/nvim/tempfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/tempfile.c b/src/nvim/tempfile.c index 41fc163936..c25da77717 100644 --- a/src/nvim/tempfile.c +++ b/src/nvim/tempfile.c @@ -60,7 +60,11 @@ void vim_deltempdir(void) char_u **files; int file_count; - if (gen_expand_wildcards(1, &NameBuff, &file_count, &files, + + // Note: We cannot just do `&NameBuff` because it is a statically + // sized array so `NameBuff == &NameBuff` according to C semantics. + char_u *buff_list[1] = {(char_u*) NameBuff}; + if (gen_expand_wildcards(1, buff_list, &file_count, &files, EW_DIR|EW_FILE|EW_SILENT) == OK) { for (int i = 0; i < file_count; ++i) { os_remove((char *)files[i]); |