Code

Fix draw_date to not format anything when time arg is NULL
authorJonas Fonseca <fonseca@diku.dk>
Tue, 17 Nov 2009 04:10:54 +0000 (23:10 -0500)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 17 Nov 2009 04:10:54 +0000 (23:10 -0500)
tig.c

diff --git a/tig.c b/tig.c
index a442024168dbf6d692e62437db4fab308f3173ac..084fc0f362c2f69879127ee8021773128b0449b1 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2149,7 +2149,7 @@ draw_field(struct view *view, enum line_type type, const char *text, int len, bo
 static bool
 draw_date(struct view *view, time_t *time)
 {
-       const char *date = mkdate(time);
+       const char *date = time ? mkdate(time) : "";
        int cols = opt_date == DATE_SHORT ? DATE_SHORT_COLS : DATE_COLS;
 
        return draw_field(view, LINE_DATE, date, cols, FALSE);