From dbcd4b65bb38cee390d59d4a04b00bf6d54e5319 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 17 Dec 2018 20:51:26 -0500 Subject: [PATCH] fixed segfault in Get tag command --- TODO.md | 1 + src/lib/view.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 3183fed..7850db7 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ ## STAGING +* Ctrl+D should not pass tag name as arg when executing tag commands * registrar doesnt match open windows when new file created and is then opened for edit or line number * implement a mini-sed command to standardize scripts across platforms without relying on sed * registrar should remove invalid windows from registry when detected diff --git a/src/lib/view.c b/src/lib/view.c index 0348c0a..e505621 100644 --- a/src/lib/view.c +++ b/src/lib/view.c @@ -161,7 +161,7 @@ static void resize(View* view, size_t width, size_t nrows, size_t off) { void view_resize(View* view, size_t width, size_t nrows) { if (view->width == width && view->nvisible == nrows) return; - size_t off = (view->rows ? view->rows[view->index]->off : 0); + size_t off = (view->nrows && view->index < view->nrows ? view->rows[view->index]->off : 0); resize(view, width, nrows, off); } -- 2.51.0