summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-23 22:12:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-23 22:12:13 +0000
commitd0a9e366dfd5c64892e900c1c655834553ed366b (patch)
treee78d5b278ea9eb3356578790d6852a342afe3f08
parent1b8074a59e640140115951bf30cfcc7ecd606ff9 (diff)
1 byte oflows; millert
-rw-r--r--usr.sbin/lpr/common_source/displayq.c8
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index ad7075f4459..d8f390f6c36 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: displayq.c,v 1.7 1997/07/17 09:14:13 deraadt Exp $ */
+/* $OpenBSD: displayq.c,v 1.8 1997/07/23 22:12:10 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: displayq.c,v 1.7 1997/07/17 09:14:13 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: displayq.c,v 1.8 1997/07/23 22:12:10 deraadt Exp $";
#endif
#endif /* not lint */
@@ -232,12 +232,12 @@ displayq(format)
putchar('\n');
(void) snprintf(line, sizeof line, "%c%s", format + '\3', RP);
cp = line;
- for (i = 0; i < requests && cp-line+10 < sizeof line; i++) {
+ for (i = 0; i < requests && cp-line+10 < sizeof(line) - 1; i++) {
cp += strlen(cp);
(void) sprintf(cp, " %d", requ[i]);
}
for (i = 0; i < users && cp-line+1+strlen(user[i]) <
- sizeof line; i++) {
+ sizeof(line) - 1; i++) {
cp += strlen(cp);
*cp++ = ' ';
(void) strcpy(cp, user[i]);
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index 286e836fcf0..4a05408f1f9 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmjob.c,v 1.7 1997/07/18 20:57:27 millert Exp $ */
+/* $OpenBSD: rmjob.c,v 1.8 1997/07/23 22:12:12 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: rmjob.c,v 1.7 1997/07/18 20:57:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: rmjob.c,v 1.8 1997/07/23 22:12:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -340,7 +340,7 @@ rmremote()
*cp++ = ' ';
strcpy(cp, user[i]);
}
- for (i = 0; i < requests && cp-buf+10 < sizeof buf; i++) {
+ for (i = 0; i < requests && cp-buf+10 < sizeof(buf) - 1; i++) {
cp += strlen(cp);
(void) sprintf(cp, " %d", requ[i]);
}