From aa9d7d8ca19f4489839f765ad7f190e8141bd001 Mon Sep 17 00:00:00 2001 From: Connor E <38229097+c-edw@users.noreply.github.com> Date: Wed, 16 Jan 2019 01:57:53 +0000 Subject: Remove usage of VLAs. --- swaybar/ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'swaybar') 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) { -- cgit v1.2.3