diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-10-09 21:27:39 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-10-09 21:27:39 +0000 |
commit | 3f8f8c27374f72075a30e57011a31c816136a94b (patch) | |
tree | 6ae212365f73eb4ccd973db5866e44b1fac51483 | |
parent | 65d9440a1ea27313093b7f2660dfb4b63205305b (diff) | |
download | execline-3f8f8c27374f72075a30e57011a31c816136a94b.tar.xz |
posix-cd: correct stralloc len after canonicalization
-rw-r--r-- | src/posix/posix-cd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/posix/posix-cd.c b/src/posix/posix-cd.c index 49a8430..f825be1 100644 --- a/src/posix/posix-cd.c +++ b/src/posix/posix-cd.c @@ -108,7 +108,8 @@ int main (int argc, char const **argv, char const *const *envp) { stralloc tmp = STRALLOC_ZERO ; if (!stralloc_ready(&tmp, sa.len + 2)) dienomem() ; - if (!path_canonicalize(tmp.s, sa.s, 1)) + tmp.len = path_canonicalize(tmp.s, sa.s, 1) ; + if (!tmp.len++) strerr_diefu4sys(111, "canonicalize ", sa.s, ": problem with ", tmp.s) ; stralloc_free(&sa) ; sa = tmp ; |