diff options
author | Pavel Platto <hinidu@gmail.com> | 2014-06-25 21:27:01 +0300 |
---|---|---|
committer | Nicolas Hillegeer <nicolas@hillegeer.com> | 2014-07-14 21:14:40 +0200 |
commit | 34330cf69798a2a8667bdc0aa76f732fe715de84 (patch) | |
tree | 49729292004a2072dcfd0afaad3ea5d62f43c6f6 /src | |
parent | 790d81582c1b48da365984f33ea669f869efcfe9 (diff) | |
download | rneovim-34330cf69798a2a8667bdc0aa76f732fe715de84.tar.gz rneovim-34330cf69798a2a8667bdc0aa76f732fe715de84.tar.bz2 rneovim-34330cf69798a2a8667bdc0aa76f732fe715de84.zip |
tempfile.c: add to clint-files and fix warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/tempfile.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/tempfile.c b/src/nvim/tempfile.c index a9472bc66a..7b45a25cd7 100644 --- a/src/nvim/tempfile.c +++ b/src/nvim/tempfile.c @@ -1,4 +1,5 @@ #include <inttypes.h> +#include <stdbool.h> #include <stdlib.h> #include <stdio.h> @@ -59,7 +60,7 @@ void vim_deltempdir(void) int i; if (vim_tempdir != NULL) { - sprintf((char *)NameBuff, "%s*", vim_tempdir); + snprintf((char *)NameBuff, MAXPATHL, "%s*", vim_tempdir); if (gen_expand_wildcards(1, &NameBuff, &file_count, &files, EW_DIR|EW_FILE|EW_SILENT) == OK) { for (i = 0; i < file_count; ++i) @@ -92,7 +93,7 @@ static void vim_settempdir(char_u *tempdir) { char_u *buf = verbose_try_malloc((size_t)MAXPATHL + 2); if (buf) { - if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL) + if (vim_FullName(tempdir, buf, MAXPATHL, false) == FAIL) STRCPY(buf, tempdir); add_pathsep(buf); vim_tempdir = vim_strsave(buf); @@ -116,7 +117,8 @@ char_u *vim_tempname(void) if (tempdir != NULL) { /* There is no need to check if the file exists, because we own the * directory and nobody else creates a file in it. */ - sprintf((char *)itmp, "%s%" PRIu32, tempdir, temp_count++); + snprintf((char *)itmp, TEMP_FILE_PATH_MAXLEN, + "%s%" PRIu32, tempdir, temp_count++); return vim_strsave(itmp); } |