summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/rmjob.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/lpr/common_source/rmjob.c')
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index a04b483..c5f79d4 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -88,7 +88,7 @@ rmjob()
if (cgetstr(bp,"lo", &LO) < 0)
LO = DEFLOCK;
cgetstr(bp, "rm", &RM);
- if (cp = checkremote())
+ if ((cp = checkremote()))
printf("Warning: %s\n", cp);
/*
@@ -325,12 +325,12 @@ rmremote()
(void)snprintf(buf, sizeof(buf), "\5%s %s", RP, all ? "-all" : person);
cp = buf;
- for (i = 0; i < users; i++) {
+ for (i = 0; i < users && cp-buf+1+strlen(user[i]) < sizeof(buf); i++) {
cp += strlen(cp);
*cp++ = ' ';
strcpy(cp, user[i]);
}
- for (i = 0; i < requests; i++) {
+ for (i = 0; i < requests && cp-buf+10 < sizeof(buf); i++) {
cp += strlen(cp);
(void) sprintf(cp, " %d", requ[i]);
}
OpenPOWER on IntegriCloud