aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-15 20:18:20 +0300
committerZyX <kp-pav@yandex.ru>2018-04-15 20:18:20 +0300
commit11f64117718d2a5c94772764eb59dce4f54b2eeb (patch)
tree15ef21cf1f03d66351c1d2c9802b844ecbb18f90
parentd084628c4b0cf8644424f40ea578a1e705c771df (diff)
downloadrneovim-11f64117718d2a5c94772764eb59dce4f54b2eeb.tar.gz
rneovim-11f64117718d2a5c94772764eb59dce4f54b2eeb.tar.bz2
rneovim-11f64117718d2a5c94772764eb59dce4f54b2eeb.zip
file_search: Silence PVS/V614: used buffer is never uninitialized
-rw-r--r--src/nvim/file_search.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 3272ce81bc..5b17b58781 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -1541,21 +1541,25 @@ void do_autocmd_dirchanged(char *new_dir, CdScope scope)
char buf[8];
switch (scope) {
- case kCdScopeGlobal:
- snprintf(buf, sizeof(buf), "global");
- break;
- case kCdScopeTab:
- snprintf(buf, sizeof(buf), "tab");
- break;
- case kCdScopeWindow:
- snprintf(buf, sizeof(buf), "window");
- break;
- case kCdScopeInvalid:
- // Should never happen.
- assert(false);
+ case kCdScopeGlobal: {
+ snprintf(buf, sizeof(buf), "global");
+ break;
+ }
+ case kCdScopeTab: {
+ snprintf(buf, sizeof(buf), "tab");
+ break;
+ }
+ case kCdScopeWindow: {
+ snprintf(buf, sizeof(buf), "window");
+ break;
+ }
+ case kCdScopeInvalid: {
+ // Should never happen.
+ assert(false);
+ }
}
- tv_dict_add_str(dict, S_LEN("scope"), buf);
+ tv_dict_add_str(dict, S_LEN("scope"), buf); // -V614
tv_dict_add_str(dict, S_LEN("cwd"), new_dir);
tv_dict_set_keys_readonly(dict);