mirror of
https://github.com/swaywm/sway.git
synced 2025-11-07 13:29:56 -05:00
s/numlen/log10/g
This commit is contained in:
parent
ed68571815
commit
038bb8cc7c
5 changed files with 5 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue