mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-27 06:46:44 -04:00
Null Termination
This commit is contained in:
parent
d56cb66f34
commit
bc166a6a57
1 changed files with 3 additions and 1 deletions
|
|
@ -3308,7 +3308,9 @@ term_spawn_new(const struct terminal *term)
|
||||||
char cwd[PATH_MAX];
|
char cwd[PATH_MAX];
|
||||||
|
|
||||||
snprintf(cwd_link, sizeof(cwd_link), "/proc/%d/cwd", term->slave);
|
snprintf(cwd_link, sizeof(cwd_link), "/proc/%d/cwd", term->slave);
|
||||||
readlink(cwd_link, cwd, PATH_MAX);
|
|
||||||
|
ssize_t length = readlink(cwd_link, cwd, PATH_MAX);
|
||||||
|
cwd[length]=0;
|
||||||
|
|
||||||
return spawn(
|
return spawn(
|
||||||
term->reaper, cwd, (char *const []){term->foot_exe, NULL},
|
term->reaper, cwd, (char *const []){term->foot_exe, NULL},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue