Remove need for command variable

This commit is contained in:
Night Kaly 2024-11-07 01:24:44 +00:00
parent 5835f5b8f7
commit 34254a9fe4
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM

4
ccc.c
View file

@ -997,11 +997,7 @@ void edit_file(void)
return;
} else {
char *filename = files->items[sel_file].path;
/* 1 for space 1 for null */
int length = strlen(editor) + strlen(filename) + 2;
char command[length];
snprintf(command, length, "%s %s", editor, filename);
pid_t pid = fork();
if (pid == 0) {
/* Child process */