aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2003-10-13 07:24:22 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2003-10-13 07:24:22 +0000
commit1a7c9b7f5e02a657410a8978d66b10ea5a382123 (patch)
tree70a199e4f89f0234dc5331fbd241122c3b25be39 /usr.sbin
parent1f85f715702dccee80638a3644a2aaf4ae03c91f (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/lpc/lpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index a559e0a52ba0..e58911c06097 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -186,7 +186,7 @@ cmdscanner(void)
if ((bp = el_gets(el, &num)) == NULL || num == 0)
quit(0, NULL);
- len = (num > MAX_CMDLINE) ? MAX_CMDLINE : num;
+ len = (num > MAX_CMDLINE - 1) ? MAX_CMDLINE - 1 : num;
memcpy(cmdline, bp, len);
cmdline[len] = 0;
history(hist, &he, H_ENTER, bp);
@@ -274,7 +274,7 @@ makeargv(void)
margc = 0;
for (cp = cmdline; *cp && (size_t)(cp - cmdline) < sizeof(cmdline) &&
- n < MAX_MARGV; n++) {
+ n < MAX_MARGV - 1; n++) {
while (isspace(*cp))
cp++;
if (*cp == '\0')