From 6eece5895e4f0c147ef21ebb4d170a54f8694182 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Thu, 27 Feb 2014 16:13:11 -0300 Subject: Fix a 'garbage value' warning found by Clang's static analyzer - Initialize lists in paragraph_start() - Remove two dead stores --- src/ops.c | 8 ++++---- src/regexp.c | 2 +- src/regexp_nfa.c | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ops.c b/src/ops.c index 5fb256e30d..7c5f53757e 100644 --- a/src/ops.c +++ b/src/ops.c @@ -4096,11 +4096,11 @@ static int fmt_check_par(linenr_T lnum, int *leader_len, char_u **leader_flags, */ int paragraph_start(linenr_T lnum) { - char_u *p; + char_u *p; int leader_len = 0; /* leader len of current line */ - char_u *leader_flags = NULL; /* flags for leader of current line */ - int next_leader_len; /* leader len of next line */ - char_u *next_leader_flags; /* flags for leader of next line */ + char_u *leader_flags = NULL; /* flags for leader of current line */ + int next_leader_len = 0; /* leader len of next line */ + char_u *next_leader_flags = NULL; /* flags for leader of next line */ int do_comments; /* format comments */ if (lnum <= 1) diff --git a/src/regexp.c b/src/regexp.c index c325a7d129..54fe5940a7 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -2520,7 +2520,7 @@ static void reginsert_nr(int op, long val, char_u *opnd) *place++ = op; *place++ = NUL; *place++ = NUL; - place = re_put_long(place, (long_u)val); + re_put_long(place, (long_u)val); } /* diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 902d46f825..3e4b74d2d2 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -524,7 +524,6 @@ static char_u *nfa_get_match_text(nfa_state_T *start) ret = alloc(len); if (ret != NULL) { - len = 0; p = start->out->out; /* skip first char, it goes into regstart */ s = ret; while (p->c > 0) { -- cgit