aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
authorConnor E <38229097+c-edw@users.noreply.github.com>2019-01-16 01:57:53 +0000
committeremersion <contact@emersion.fr>2019-01-16 13:02:26 +0100
commitaa9d7d8ca19f4489839f765ad7f190e8141bd001 (patch)
treea00776437e012fb3f800b60c0bb7c25fdbf261b2 /swaybar
parent02bbefda20b9a4f86e740d33bbaa21c661bb2fac (diff)
Remove usage of VLAs.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/ipc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index 0dc39439..9fe3e626 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -13,9 +13,10 @@
void ipc_send_workspace_command(struct swaybar *bar, const char *ws) {
const char *fmt = "workspace \"%s\"";
uint32_t size = snprintf(NULL, 0, fmt, ws);
- char command[size];
+ char *command = malloc(sizeof(char) * size);
snprintf(command, size, fmt, ws);
ipc_single_command(bar->ipc_socketfd, IPC_COMMAND, command, &size);
+ free(command);
}
char *parse_font(const char *font) {