From 038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 23 Jan 2016 15:50:57 -0500 Subject: s/numlen/log10/g --- sway/commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sway') 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 #include #include +#include #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; -- cgit v1.2.3