mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 01:18:52 +00:00
Do not return a buffer on the stack, mentioned by jsg a while ago.
This commit is contained in:
parent
48e6ebbe1e
commit
0f9e0d1cfe
6
cmd.c
6
cmd.c
@ -1325,8 +1325,10 @@ find_home:
|
|||||||
return (s->cwd);
|
return (s->cwd);
|
||||||
|
|
||||||
complete_path:
|
complete_path:
|
||||||
if (root[skip] == '\0')
|
if (root[skip] == '\0') {
|
||||||
return (root);
|
strlcpy(path, root, sizeof path);
|
||||||
|
return (path);
|
||||||
|
}
|
||||||
n = snprintf(path, sizeof path, "%s/%s", root, cwd + skip);
|
n = snprintf(path, sizeof path, "%s/%s", root, cwd + skip);
|
||||||
if (n > 0 && (size_t)n < sizeof path)
|
if (n > 0 && (size_t)n < sizeof path)
|
||||||
return (path);
|
return (path);
|
||||||
|
Loading…
Reference in New Issue
Block a user