diff options
author | Connor E <38229097+c-edw@users.noreply.github.com> | 2019-01-16 10:18:46 +0000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-16 13:02:26 +0100 |
commit | 70637b40fe98bda420e279e2e059fc93a9f538d6 (patch) | |
tree | 13f98429c8891436a7f6a2136a9627230378bd39 /swaybar/ipc.c | |
parent | de6f5b345380e80b4d59ebc569697683af064424 (diff) |
Fixes for small existing bugs.
Diffstat (limited to 'swaybar/ipc.c')
-rw-r--r-- | swaybar/ipc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |