aboutsummaryrefslogtreecommitdiff
path: root/swaybar/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/ipc.c')
-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) {