aboutsummaryrefslogtreecommitdiffstats
path: root/src/redo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redo.c')
-rw-r--r--src/redo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/redo.c b/src/redo.c
index 514c235..cb6ad19 100644
--- a/src/redo.c
+++ b/src/redo.c
@@ -12,7 +12,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
-#include <math.h>
#include <limits.h>
#include <unistd.h>
@@ -23,8 +22,8 @@
/* Returns the amount of digits a number n has in decimal. */
-static inline int digits(unsigned n) {
- return (int) log10(n) + 1;
+static inline unsigned digits(unsigned n) {
+ return n ? 1 + digits(n/10) : n;
}
int main(int argc, char *argv[]) {