From 3de1bc4bf9bd530fbeff74174d4e0ba82f92e9e4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 17 Dec 2019 01:14:22 -0500 Subject: [PATCH] fileio: use uint64_t for temp_count #11555 Band-aid workaround to file collision when using `tempname` for temporary batchfiles. --- src/nvim/fileio.c | 4 ++-- 1 file 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); }