aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cache.h2
-rw-r--r--pager.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/cache.h b/cache.h
index 29ed24b80..db02a2de7 100644
--- a/cache.h
+++ b/cache.h
@@ -1213,7 +1213,7 @@ extern const char *pager_program;
extern int pager_in_use(void);
extern int pager_use_color;
extern int term_columns(void);
-extern int decimal_width(int);
+extern int decimal_width(uintmax_t);
extern int check_pager_config(const char *cmd);
extern const char *editor_program;
diff --git a/pager.c b/pager.c
index fa19765eb..314210351 100644
--- a/pager.c
+++ b/pager.c
@@ -139,12 +139,12 @@ int term_columns(void)
/*
* How many columns do we need to show this number in decimal?
*/
-int decimal_width(int number)
+int decimal_width(uintmax_t number)
{
- int i, width;
+ int width;
- for (width = 1, i = 10; i <= number; width++)
- i *= 10;
+ for (width = 1; number >= 10; width++)
+ number /= 10;
return width;
}