Code

Fix draw_lineno to always set the static format buffer
authorJonas Fonseca <fonseca@diku.dk>
Sun, 15 Feb 2009 17:23:44 +0000 (18:23 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Sun, 15 Feb 2009 17:23:44 +0000 (18:23 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 725ace02579782ab55d4b511cfd89c8c8fc2f19d..b9d7a637e20293a9cb7f46c8bc77420a8a5363e2 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2032,9 +2032,7 @@ draw_lineno(struct view *view, unsigned int lineno)
        if (lineno == 1 || (lineno % opt_num_interval) == 0) {
                static char fmt[] = "%1ld";
 
-               if (view->digits <= 9)
-                       fmt[1] = '0' + digits3;
-
+               fmt[1] = '0' + (view->digits <= 9 ? digits3 : 1);
                if (string_format(number, fmt, lineno))
                        text = number;
        }