aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/cursor_shape.c6
-rw-r--r--src/nvim/quickfix.c4
-rw-r--r--src/nvim/regexp.c1
-rw-r--r--src/nvim/spell.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c
index 0377cb97e5..96ff1e5631 100644
--- a/src/nvim/cursor_shape.c
+++ b/src/nvim/cursor_shape.c
@@ -118,7 +118,6 @@ char_u *parse_shape_opt(int what)
// Repeat for all modes before the colon.
// For the 'a' mode, we loop to handle all the modes.
all_idx = -1;
- assert(modep < colonp);
while (modep < colonp || all_idx >= 0) {
if (all_idx < 0) {
// Find the mode
@@ -230,8 +229,9 @@ char_u *parse_shape_opt(int what)
}
}
modep = p;
- if (*modep == ',')
- ++modep;
+ if (modep != NULL && *modep == ',') {
+ modep++;
+ }
}
}
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index e24ccc38b0..be6e48465f 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -5139,9 +5139,7 @@ static int qf_setprop_context(qf_info_T *qi, int qf_idx, dictitem_T *di)
{
tv_free(qi->qf_lists[qf_idx].qf_ctx);
typval_T *ctx = xcalloc(1, sizeof(typval_T));
- if (ctx != NULL) {
- tv_copy(&di->di_tv, ctx);
- }
+ tv_copy(&di->di_tv, ctx);
qi->qf_lists[qf_idx].qf_ctx = ctx;
return OK;
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 06b99d0b75..37d71699dd 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -5522,6 +5522,7 @@ do_class:
* there is an error.
*/
static char_u *regnext(char_u *p)
+ FUNC_ATTR_NONNULL_ALL
{
int offset;
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 40bb882948..760ac2e6c1 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -2305,6 +2305,7 @@ static int find_region(char_u *rp, char_u *region)
///
/// @returns Case type of word
int captype(char_u *word, char_u *end)
+ FUNC_ATTR_NONNULL_ARG(1)
{
char_u *p;
int c;
@@ -2355,6 +2356,7 @@ int captype(char_u *word, char_u *end)
// capital. So that make_case_word() can turn WOrd into Word.
// Add ALLCAP for "WOrD".
static int badword_captype(char_u *word, char_u *end)
+ FUNC_ATTR_NONNULL_ALL
{
int flags = captype(word, end);
int c;