diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-12-17 01:14:22 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-12-16 22:14:22 -0800 |
commit | 3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4 (patch) | |
tree | 53bde76e39d834a6641c84b6a1a63fd03396520d /src/nvim/fileio.c | |
parent | 251b20e5334e1ff8af7fdd37ca1770ad485f031b (diff) | |
download | rneovim-3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4.tar.gz rneovim-3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4.tar.bz2 rneovim-3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4.zip |
fileio: use uint64_t for temp_count #11555
Band-aid workaround to file collision when using `tempname` for temporary batchfiles.
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index f518e59acc..865da25009 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -5360,7 +5360,7 @@ static bool vim_settempdir(char *tempdir) char_u *vim_tempname(void) { // Temp filename counter. - static uint32_t temp_count; + static uint64_t temp_count; char_u *tempdir = vim_gettempdir(); if (!tempdir) { @@ -5371,7 +5371,7 @@ char_u *vim_tempname(void) // and nobody else creates a file in it. char_u template[TEMP_FILE_PATH_MAXLEN]; snprintf((char *)template, TEMP_FILE_PATH_MAXLEN, - "%s%" PRIu32, tempdir, temp_count++); + "%s%" PRIu64, tempdir, temp_count++); return vim_strsave(template); } |