diff options
author | Connor E <38229097+c-edw@users.noreply.github.com> | 2019-01-16 01:57:53 +0000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-16 13:02:26 +0100 |
commit | aa9d7d8ca19f4489839f765ad7f190e8141bd001 (patch) | |
tree | a00776437e012fb3f800b60c0bb7c25fdbf261b2 /swaybar | |
parent | 02bbefda20b9a4f86e740d33bbaa21c661bb2fac (diff) |
Remove usage of VLAs.
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/ipc.c | 3 |
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) { |