aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-24 03:02:51 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-24 03:02:51 +0100
commitc8cf3f70f979a6eb373ec1ebdf8f80bc42dcd633 (patch)
tree9cf6cec9b5d6a7217c211f06ab0c6c9b5400d0c1 /common/util.c
parentuse log10 in numlen (diff)
downloadsway-c8cf3f70f979a6eb373ec1ebdf8f80bc42dcd633.tar.gz
sway-c8cf3f70f979a6eb373ec1ebdf8f80bc42dcd633.tar.zst
sway-c8cf3f70f979a6eb373ec1ebdf8f80bc42dcd633.zip
numlen(0) == 1
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/util.c b/common/util.c
index 25a3e861..13397437 100644
--- a/common/util.c
+++ b/common/util.c
@@ -8,7 +8,7 @@ int wrap(int i, int max) {
8 8
9int numlen(int n) { 9int numlen(int n) {
10 if (n == 0) { 10 if (n == 0) {
11 return n; 11 return 1;
12 } 12 }
13 return log10(n) + 1; 13 return log10(n) + 1;
14} 14}