Code

Fix floating point bug in the blame reporting
authorJonas Fonseca <fonseca@diku.dk>
Sat, 24 Jan 2009 12:24:04 +0000 (13:24 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Sat, 24 Jan 2009 12:24:52 +0000 (13:24 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 16dba6be8c2b0723bd1d145b073f10d08b3f1701..ec7f26732597b98e5f6d36d4c78692cee9cf8839 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4062,7 +4062,7 @@ blame_read(struct view *view, char *line)
        if (!commit) {
                commit = parse_blame_commit(view, line, &blamed);
                string_format(view->ref, "%s %2d%%", view->vid,
-                             blamed * 100 / view->lines);
+                             view->lines ? blamed * 100 / view->lines : 0);
 
        } else if (match_blame_header("author ", &line)) {
                string_ncopy(commit->author, line, strlen(line));