aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-11-10 20:05:42 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-11-10 20:05:42 -0500
commitfc19f0c4c6773ff8b10c14492da2acf3601d8cbc (patch)
tree68ecc9a6718caf0cdb1bca365ce6373944af1357 /src/nvim/message.c
parent3080672650b1a6583684edfdafef7e07c0c7cf56 (diff)
parenta6548e4fb34d50fbd49d0878618c3aecefabe79b (diff)
downloadrneovim-fc19f0c4c6773ff8b10c14492da2acf3601d8cbc.tar.gz
rneovim-fc19f0c4c6773ff8b10c14492da2acf3601d8cbc.tar.bz2
rneovim-fc19f0c4c6773ff8b10c14492da2acf3601d8cbc.zip
Merge pull request #1431 from elmart/clang-analysis-fixes-2
Fix clang analysis warnings. (2)
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 58dbee8cf9..ee83fd371e 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -12,6 +12,7 @@
#define MESSAGE_FILE /* don't include prototype for smsg() */
+#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
@@ -691,8 +692,10 @@ int delete_first_msg(void)
return FAIL;
p = first_msg_hist;
first_msg_hist = p->next;
- if (first_msg_hist == NULL)
- last_msg_hist = NULL; /* history is empty */
+ if (first_msg_hist == NULL) { /* history is becoming empty */
+ assert(msg_hist_len == 1);
+ last_msg_hist = NULL;
+ }
free(p->msg);
free(p);
--msg_hist_len;
@@ -3320,7 +3323,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs)
case 'c':
case 's':
case 'S':
- length_modifier = '\0';
str_arg_l = 1;
switch (fmt_spec) {
case '%':
@@ -3584,7 +3586,6 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs)
* zero value is formatted with an
* explicit precision of zero */
precision = num_of_digits + 1;
- precision_specified = 1;
}
}
/* zero padding to specified precision? */