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/lpd | |
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/lpd')
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 12 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/recvjob.c | 6 |
2 files changed, 8 insertions, 10 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 3d1400f..b40a06d 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1197,7 +1197,6 @@ sendmail(user, bombed) int dtablesize; int p[2], s; register char *cp; - char buf[100]; struct stat stb; FILE *fp; @@ -1211,8 +1210,7 @@ sendmail(user, bombed) cp++; else cp = _PATH_SENDMAIL; - sprintf(buf, "%s@%s", user, fromhost); - execl(_PATH_SENDMAIL, cp, buf, 0); + execl(_PATH_SENDMAIL, cp, "-t", 0); exit(0); } else if (s > 0) { /* parent */ dup2(p[1], 1); @@ -1620,14 +1618,14 @@ setty() } } -#if __STDC__ +#ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif static void -#if __STDC__ +#ifdef __STDC__ pstatus(const char *msg, ...) #else pstatus(msg, va_alist) @@ -1638,7 +1636,7 @@ pstatus(msg, va_alist) register int fd; char buf[BUFSIZ]; va_list ap; -#if __STDC__ +#ifdef __STDC__ va_start(ap, msg); #else va_start(ap); @@ -1651,7 +1649,7 @@ pstatus(msg, va_alist) exit(1); } ftruncate(fd, 0); - (void)vsnprintf(buf, sizeof(buf), msg, ap); + (void)vsnprintf(buf, sizeof(buf) - 1, msg, ap); va_end(ap); strcat(buf, "\n"); (void) write(fd, buf, strlen(buf)); diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c index 5c1d027..6ed50c3 100644 --- a/usr.sbin/lpr/lpd/recvjob.c +++ b/usr.sbin/lpr/lpd/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); |