diff options
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; +} |