do_for_each_reflog(): return early on error
[gitweb.git] / pager.c
diff --git a/pager.c b/pager.c
index b7909678f459d90d1c8907c78bb5fcb512fe558d..05584dead6728ceff818630fbccaa91bb6c6b686 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -147,3 +147,15 @@ int term_columns(void)
 
        return term_columns_at_startup;
 }
+
+/*
+ * How many columns do we need to show this number in decimal?
+ */
+int decimal_width(int number)
+{
+       int i, width;
+
+       for (width = 1, i = 10; i <= number; width++)
+               i *= 10;
+       return width;
+}