mirror of
https://github.com/swaywm/sway.git
synced 2026-06-13 14:33:19 -04:00
Remove usage of VLAs.
This commit is contained in:
parent
02bbefda20
commit
aa9d7d8ca1
7 changed files with 32 additions and 11 deletions
|
|
@ -28,9 +28,10 @@ static bool terminal_execute(char *terminal, char *command) {
|
|||
fprintf(tmp, "#!/bin/sh\nrm %s\n%s", fname, command);
|
||||
fclose(tmp);
|
||||
chmod(fname, S_IRUSR | S_IWUSR | S_IXUSR);
|
||||
char cmd[strlen(terminal) + strlen(" -e ") + strlen(fname) + 1];
|
||||
char *cmd = malloc(sizeof(char) * (strlen(terminal) + strlen(" -e ") + strlen(fname) + 1));
|
||||
sprintf(cmd, "%s -e %s", terminal, fname);
|
||||
execl("/bin/sh", "/bin/sh", "-c", cmd, NULL);
|
||||
free(cmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue