=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- src/usr.bin/tmux/cmd.c 2012/04/22 05:24:05 1.64 +++ src/usr.bin/tmux/cmd.c 2012/04/23 22:43:09 1.65 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.64 2012/04/22 05:24:05 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.65 2012/04/23 22:43:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1325,8 +1325,10 @@ return (s->cwd); complete_path: - if (root[skip] == '\0') - return (root); + if (root[skip] == '\0') { + strlcpy(path, root, sizeof path); + return (path); + } n = snprintf(path, sizeof path, "%s/%s", root, cwd + skip); if (n > 0 && (size_t)n < sizeof path) return (path);