aboutsummaryrefslogtreecommitdiff
path: root/src/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.c')
-rw-r--r--src/lib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.c b/src/lib.c
index 0a98435..b7ee492 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -24,3 +24,14 @@ char *formatBytes(double *bytes) {
return SIZES[div];
}
+
+int intlen(unsigned i) {
+ int l = 1;
+
+ while (i > 9) {
+ l++;
+ i /= 10;
+ }
+
+ return l;
+}