Code

Fixed some uninitialized variable warnings
authorSebastian Harl <sh@tokkee.org>
Fri, 3 Apr 2009 16:34:08 +0000 (18:34 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 13 Apr 2009 15:36:52 +0000 (17:36 +0200)
GCC 4.3.3, when used with -Wall, emits warnings that those variables "may be
used uninitialized in this function".

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c

diff --git a/tig.c b/tig.c
index cffa86d5fcafdd22544a19e7283f5e1f3241749d..e52185e4be36b0f15174ff2faad7e2c50196c933 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1614,7 +1614,7 @@ static int
 option_bind_command(int argc, const char *argv[])
 {
        enum request request;
-       int keymap;
+       int keymap = -1;
        int key;
 
        if (argc < 3) {
@@ -5485,7 +5485,7 @@ status_update_files(struct view *view, struct line *line)
        struct line *pos = view->line + view->lines;
        int files = 0;
        int file, done;
-       int cursor_y, cursor_x;
+       int cursor_y = -1, cursor_x = -1;
 
        if (!status_update_prepare(&io, line->type))
                return FALSE;