diff options
author | 2016-01-23 15:50:57 -0500 | |
---|---|---|
committer | 2016-01-23 15:51:38 -0500 | |
commit | 038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370 (patch) | |
tree | 99d79313f422dccfc45307d5960eb873c3d1e226 /sway | |
parent | Merge pull request #466 from christophgysin/swaybar_usage (diff) | |
download | sway-038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370.tar.gz sway-038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370.tar.zst sway-038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370.zip |
s/numlen/log10/g
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c index 9f6e5032..58fc4aa5 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <limits.h> | 14 | #include <limits.h> |
15 | #include <float.h> | 15 | #include <float.h> |
16 | #include <libinput.h> | 16 | #include <libinput.h> |
17 | #include <math.h> | ||
17 | #include "stringop.h" | 18 | #include "stringop.h" |
18 | #include "layout.h" | 19 | #include "layout.h" |
19 | #include "focus.h" | 20 | #include "focus.h" |
@@ -1580,7 +1581,7 @@ static struct cmd_results *cmd_bar(int argc, char **argv) { | |||
1580 | int i; | 1581 | int i; |
1581 | for (i = 0; i < config->bars->length; ++i) { | 1582 | for (i = 0; i < config->bars->length; ++i) { |
1582 | if (bar == config->bars->items[i]) { | 1583 | if (bar == config->bars->items[i]) { |
1583 | const int len = 5 + numlen(i); // "bar-" + i + \0 | 1584 | const int len = 5 + log10(i) + 1; // "bar-" + i + \0 |
1584 | bar->id = malloc(len * sizeof(char)); | 1585 | bar->id = malloc(len * sizeof(char)); |
1585 | snprintf(bar->id, len, "bar-%d", i); | 1586 | snprintf(bar->id, len, "bar-%d", i); |
1586 | break; | 1587 | break; |