ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit b0a9b858d69db60a08b83d9cca5bb2ba9d7210b5
parent ddd016380cc9b83226f1343468d91519535ac828
Author: Mattias Andrée <maandree@kth.se>
Date:   Sat Mar 26 15:46:29 +0100

pwdx: fix off-by-one bug

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
pwdx.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pwdx.c b/pwdx.c @@ -31,7 +31,7 @@ main(int argc, char *argv[]) for (; argc > 0; argc--, argv++) { n = snprintf(path, sizeof(path), "/proc/%s/cwd", *argv); - if (n < 0 || n > sizeof(path)) { + if (n < 0 || n >= sizeof(path)) { errno = ESRCH; } else { n = readlink(path, target, sizeof(target) - 1);