aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-01-23 15:50:57 -0500
committerDrew DeVault <sir@cmpwn.com>2016-01-23 15:51:38 -0500
commit038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370 (patch)
tree99d79313f422dccfc45307d5960eb873c3d1e226 /sway
parented685718155d24562a752576f4c5340792cac4a5 (diff)
downloadsway-038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370.tar.xz
s/numlen/log10/g
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c3
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 @@
#include <limits.h>
#include <float.h>
#include <libinput.h>
+#include <math.h>
#include "stringop.h"
#include "layout.h"
#include "focus.h"
@@ -1580,7 +1581,7 @@ static struct cmd_results *cmd_bar(int argc, char **argv) {
int i;
for (i = 0; i < config->bars->length; ++i) {
if (bar == config->bars->items[i]) {
- const int len = 5 + numlen(i); // "bar-" + i + \0
+ const int len = 5 + log10(i) + 1; // "bar-" + i + \0
bar->id = malloc(len * sizeof(char));
snprintf(bar->id, len, "bar-%d", i);
break;