diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-05-20 08:36:40 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-05-20 08:36:40 +0200 |
commit | 8e20b77bd1604062f0cf7182a2e3a6ae8c9fc6d3 (patch) | |
tree | beb3ff15831ad8df3b7e29bcac4b1d76b0bc5105 /src | |
parent | 7e9afca9901a650791ab50b8eb3f87f7a1f4cf3c (diff) | |
download | rneovim-8e20b77bd1604062f0cf7182a2e3a6ae8c9fc6d3.tar.gz rneovim-8e20b77bd1604062f0cf7182a2e3a6ae8c9fc6d3.tar.bz2 rneovim-8e20b77bd1604062f0cf7182a2e3a6ae8c9fc6d3.zip |
strings.c: Fix PVS/V781: value of 'l + 1' is checked after it was used
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/strings.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index b3a0e4816b..52677738e8 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -1253,11 +1253,11 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap, } // Cast to char to avoid a conversion warning on Ubuntu 12.04. + assert(l + 1 < sizeof(format)); format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec); format[l + 1] = NUL; // Regular float number - assert(l + 1 < sizeof(format)); str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f); assert(str_arg_l < sizeof(tmp)); |