Fix warnings: edit.c: ins_compl_next_buf(): Np dereference: FP.

Problem    : Dereference of null pointer @ 3234.
Diagnostic : False positive.
Rationale  : `wp` is local static, so maintains value between calls.
             First time function is called for a given flag will have
             `buf == curbuf`, implying `wp` initialization.
Resolution : Assert variable always having been initialized.
This commit is contained in:
Eliseo Martínez 2014-11-05 21:44:19 +01:00
parent 997c0b3939
commit 0bda79a847

View File

@ -3231,6 +3231,7 @@ static buf_T *ins_compl_next_buf(buf_T *buf, int flag)
if (flag == 'w') { /* just windows */
if (buf == curbuf) /* first call for this flag/expansion */
wp = curwin;
assert(wp);
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)
;