diff options
author | imp <imp@FreeBSD.org> | 1997-07-29 13:24:01 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1997-07-29 13:24:01 +0000 |
commit | 2f9d4f24114eb44bfde492debae4196f2127b888 (patch) | |
tree | c88cde887a350ef06b19b3df147ebcd1d121816e /usr.sbin/lpr/common_source | |
parent | f827c62c9475af527049150cf7d9a49b7de4a320 (diff) | |
download | FreeBSD-src-2f9d4f24114eb44bfde492debae4196f2127b888.zip FreeBSD-src-2f9d4f24114eb44bfde492debae4196f2127b888.tar.gz |
Two minor, pedantic fixes from bde for my last pedantic fixes, plus
the following from recent OpenBSD changes. These changes (and all
I've made) should be merged back into 2.2 when they are vetted in
-current.
common.c:
OpenBSD 1.7: mickey: #if __STDC__ --> #ifdef __STDC__
displayq.c:
OpenBSD 1.8: deraadt: 1 byte oflows; millert
rmjob.c:
OpenBSD 1.8: deraadt: 1 byte oflows; millert
cmds.c:
OpenBSD 1.9: grr: restore traditional "all" keyword option - see lpc(8)
[[ This makes lpc status all work again -- imp ]]
printjob.c:
OpenBSD 1.17: deraadt: use sendmail -t
OpenBSD 1.16: mickey: #if __STDC__ --> #ifdef __STDC__
OpenBSD 1.15: deraadt: 1 byte oflow; Don.Lewis@tsc.tdk.com
recvjob.c:
OpenBSD 1.11: mickey: #if __STDC__ --> #ifdef __STDC__
lpr.c:
OpenBSD 1.19: mickey: #if __STDC__ --> #ifdef __STDC__
Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin/lpr/common_source')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 8 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/displayq.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/recvjob.c | 6 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/rmjob.c | 2 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/startdaemon.c | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 6cb4098..b7960c2 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -308,7 +308,7 @@ checkremote() if (RM != NULL) { /* get the official name of the local host */ gethostname(name, sizeof(name)); - name[sizeof(name)-1] = '\0'; + name[sizeof(name) - 1] = '\0'; hp = gethostbyname(name); if (hp == (struct hostent *) NULL) { (void) snprintf(errbuf, sizeof(errbuf), @@ -352,14 +352,14 @@ delay(n) (void) select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tdelay); } -#if __STDC__ +#ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif void -#if __STDC__ +#ifdef __STDC__ fatal(const char *msg, ...) #else fatal(msg, va_alist) @@ -368,7 +368,7 @@ fatal(msg, va_alist) #endif { va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, msg); #else va_start(ap); diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index eafaf0c..d326e79 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -224,12 +224,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/recvjob.c b/usr.sbin/lpr/common_source/recvjob.c index 5c1d027..6ed50c3 100644 --- a/usr.sbin/lpr/common_source/recvjob.c +++ b/usr.sbin/lpr/common_source/recvjob.c @@ -336,14 +336,14 @@ rcleanup(signo) dfname[0] = '\0'; } -#if __STDC__ +#ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif static void -#if __STDC__ +#ifdef __STDC__ frecverr(const char *msg, ...) #else frecverr(msg, va_alist) @@ -352,7 +352,7 @@ frecverr(msg, va_alist) #endif { va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, msg); #else va_start(ap); diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c index c5f79d4..c44f172 100644 --- a/usr.sbin/lpr/common_source/rmjob.c +++ b/usr.sbin/lpr/common_source/rmjob.c @@ -330,7 +330,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]); } diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c index 13722f4..ca24c82 100644 --- a/usr.sbin/lpr/common_source/startdaemon.c +++ b/usr.sbin/lpr/common_source/startdaemon.c @@ -83,7 +83,7 @@ startdaemon(printer) return(0); } seteuid(uid); - if (snprintf(buf, sizeof(buf), "\1%s\n", printer) > sizeof(buf)-1) { + if (snprintf(buf, sizeof(buf), "\1%s\n", printer) > sizeof(buf) - 1) { close(s); return (0); } |