Code

Fix segfault where current_view would become >= sizeof(display)
authorJonas Fonseca <fonseca@diku.dk>
Mon, 29 May 2006 21:29:38 +0000 (23:29 +0200)
committerJonas Fonseca <fonseca@antimatter.localdomain>
Mon, 29 May 2006 21:29:38 +0000 (23:29 +0200)
Hard code current_view indexes for split screen setup.

Reported-by: Dennis (dst_) on #git
tig.c

diff --git a/tig.c b/tig.c
index e7deb2ec1d1ce423c1a1117527fbe487c91ac86a..c323cf83167cc7854b9d362606eab79a92a4f5c8 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1411,9 +1411,9 @@ open_view(struct view *prev, enum request request, enum open_flags flags)
        }
 
        if (split) {
-               display[current_view + 1] = view;
+               display[1] = view;
                if (!backgrounded)
-                       current_view++;
+                       current_view = 1;
        } else {
                /* Maximize the current view. */
                memset(display, 0, sizeof(display));