summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/cmd1.c
diff options
context:
space:
mode:
authormikeh <mikeh@FreeBSD.org>2001-03-25 04:57:05 +0000
committermikeh <mikeh@FreeBSD.org>2001-03-25 04:57:05 +0000
commite51e7e067d9cfc20e2881f888c5f45046c153df8 (patch)
treeb1ac3afa472ab794d2a7118bc10ebee16c55812f /usr.bin/mail/cmd1.c
parentafd190c2240ce9ef47e8180f3d48af53f636952f (diff)
downloadFreeBSD-src-e51e7e067d9cfc20e2881f888c5f45046c153df8.zip
FreeBSD-src-e51e7e067d9cfc20e2881f888c5f45046c153df8.tar.gz
Merge various changes from OpenBSD and NetBSD.
o remove panic() in favor of err(3) and use err(3) functions consistently throughout o use stat(2)'s S_IS* macros rather than S_IF* o [r]index -> str[r]chr o convert some static buffers to dynamic ones o use real tempfiles rather than reopening the same templates o rename some functions that clash with libc o convert wait_status from union to int and use wait(2) status macros o fix multiple potential buffer overflows o fix a few comments o add $FreeBSD$ Reviewed by: nra, nectar (earlier version)
Diffstat (limited to 'usr.bin/mail/cmd1.c')
-rw-r--r--usr.bin/mail/cmd1.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c
index 25c08fa..0800d0a 100644
--- a/usr.bin/mail/cmd1.c
+++ b/usr.bin/mail/cmd1.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)cmd1.c 8.1 (Berkeley) 6/6/93";
+#endif
+static const char rcsid[] =
+ "$FreeBSD$";
#endif /* not lint */
#include "rcv.h"
@@ -316,7 +320,7 @@ type1(msgvec, doign, page)
cp = _PATH_MORE;
obuf = Popen(cp, "w");
if (obuf == NULL) {
- perror(cp);
+ warnx("%s", cp);
obuf = stdout;
} else
signal(SIGPIPE, brokpipe);
@@ -328,7 +332,7 @@ type1(msgvec, doign, page)
dot = mp;
if (value("quiet") == NOSTR)
fprintf(obuf, "Message %d:\n", *ip);
- (void) send(mp, obuf, doign ? ignore : 0, NOSTR);
+ (void) sendmessage(mp, obuf, doign ? ignore : 0, NOSTR);
}
close_pipe:
if (obuf != stdout) {
@@ -387,10 +391,10 @@ top(msgvec)
if (!lineb)
printf("\n");
for (lines = 0; lines < c && lines <= topl; lines++) {
- if (readline(ibuf, linebuf, LINESIZE) < 0)
+ if (readline(ibuf, linebuf, sizeof(linebuf)) < 0)
break;
puts(linebuf);
- lineb = blankline(linebuf);
+ lineb = strspn(linebuf, " \t") == strlen(linebuf);
}
}
return(0);
@@ -437,10 +441,10 @@ mboxit(msgvec)
int
folders()
{
- char dirname[BUFSIZ];
+ char dirname[PATHSIZE];
char *cmd;
- if (getfold(dirname) < 0) {
+ if (getfold(dirname, sizeof(dirname)) < 0) {
printf("No value set for \"folder\"\n");
return 1;
}
OpenPOWER on IntegriCloud