diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-07-17 23:00:26 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-07-17 23:00:26 +0200 |
| commit | 75c7c61ecc4038340fa3acfab71ee19bbafa48a8 (patch) | |
| tree | 6f9d61221a364fec36a138ea892e2083f776d740 /main.c | |
| parent | b1d298556edd2f4bcb4e031c9fc6307cde79cca9 (diff) | |
| download | vis-75c7c61ecc4038340fa3acfab71ee19bbafa48a8.tar.gz vis-75c7c61ecc4038340fa3acfab71ee19bbafa48a8.tar.xz | |
vis: fix coverity issue 157025
The static analyzer can currently not infere that there always exists
at least one selection.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |
