Skip to content

Commit

Permalink
vis: fix coverity issue 157025
Browse files Browse the repository at this point in the history
The static analyzer can currently not infere that there always exists
at least one selection.
  • Loading branch information
martanne committed Jul 17, 2017
1 parent b1d2985 commit 75c7c61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,9 +1326,11 @@ static const char *selections_new(Vis *vis, const char *keys, const Arg *arg) {
for (Selection *s = view_selections(view); s; s = view_selections_next(s))
sel = s;
break;
default:
return keys;
}

if (!sel)
return keys;

size_t oldpos = view_cursors_pos(sel);
if (arg->i > 0)
view_line_down(sel);
Expand Down

0 comments on commit 75c7c61

Please sign in to comment.