Remove usage of VLAs.

This commit is contained in:
Connor E 2019-01-16 01:57:53 +00:00 committed by emersion
parent 02bbefda20
commit aa9d7d8ca1
7 changed files with 32 additions and 11 deletions

View file

@ -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) {