From 70637b40fe98bda420e279e2e059fc93a9f538d6 Mon Sep 17 00:00:00 2001 From: Connor E <38229097+c-edw@users.noreply.github.com> Date: Wed, 16 Jan 2019 10:18:46 +0000 Subject: Fixes for small existing bugs. --- swaybar/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swaybar') diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 9fe3e626..5565dc76 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -13,7 +13,7 @@ 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 = malloc(sizeof(char) * size); + char *command = malloc(sizeof(char) * (size + 1)); snprintf(command, size, fmt, ws); ipc_single_command(bar->ipc_socketfd, IPC_COMMAND, command, &size); free(command); -- cgit v1.2.3-54-g00ecf