diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index 29c068d8c5bc..a1b9dd7414cf 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -107,7 +107,7 @@ printlink(name) int lnklen; char path[MAXPATHLEN + 1]; - if ((lnklen = readlink(name, path, MAXPATHLEN)) == -1) { + if ((lnklen = readlink(name, path, MAXPATHLEN - 1)) == -1) { warn("%s", name); return; } diff --git a/usr.bin/rdist/server.c b/usr.bin/rdist/server.c index 98b1e4a7096c..d91d723084b5 100644 --- a/usr.bin/rdist/server.c +++ b/usr.bin/rdist/server.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; #endif static const char rcsid[] = - "$Id: server.c,v 1.7 1998/04/06 06:18:32 charnier Exp $"; + "$Id: server.c,v 1.8 1998/04/20 06:20:24 charnier Exp $"; #endif /* not lint */ #include @@ -473,7 +473,7 @@ sendf(rname, opts) (void) write(rem, buf, strlen(buf)); if (response() < 0) return; - sizerr = (readlink(target, buf, BUFSIZ) != stb.st_size); + sizerr = (readlink(target, buf, BUFSIZ - 1) != stb.st_size); (void) write(rem, buf, stb.st_size); if (debug) printf("readlink = %.*s\n", (int)stb.st_size, buf); @@ -870,7 +870,7 @@ recvf(cmd, type) if (opts & COMPARE) { char tbuf[BUFSIZ]; - if ((i = readlink(target, tbuf, BUFSIZ)) >= 0 && + if ((i = readlink(target, tbuf, BUFSIZ - 1)) >= 0 && i == size && strncmp(buf, tbuf, size) == 0) { (void) unlink(new); ack();