diff options
| author | Philippe Charnier <charnier@FreeBSD.org> | 1997-07-24 06:56:33 +0000 |
|---|---|---|
| committer | Philippe Charnier <charnier@FreeBSD.org> | 1997-07-24 06:56:33 +0000 |
| commit | 0e11b68bdd00abc0a282a4182779d122b7599dfe (patch) | |
| tree | d3f8e0cb7434de9710f6c0a2fc80e73153d43bf7 | |
| parent | a4453045b03eb69cecd3caa130baa1e834766dd4 (diff) | |
Notes
| -rw-r--r-- | usr.bin/mail/aux.c | 4 | ||||
| -rw-r--r-- | usr.bin/mail/fio.c | 5 | ||||
| -rw-r--r-- | usr.bin/mail/temp.c | 12 |
3 files changed, 11 insertions, 10 deletions
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c index f6f72117922cb..d8d385ac2080f 100644 --- a/usr.bin/mail/aux.c +++ b/usr.bin/mail/aux.c @@ -179,7 +179,7 @@ hfield(field, mp) while (lc > 0) { if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0) return oldhfield; - if (hfield = ishfield(linebuf, colon, field)) + if ((hfield = ishfield(linebuf, colon, field)) != NULL) oldhfield = save2str(hfield, oldhfield); } return oldhfield; @@ -572,7 +572,7 @@ name1(mp, reptype) if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR) return cp; ibuf = setinput(mp); - namebuf[0] = 0; + namebuf[0] = '\0'; if (readline(ibuf, linebuf, LINESIZE) < 0) return(savestr(namebuf)); newname: diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index 4f2a8a81707ea..2d03a60aadac6 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -70,8 +70,7 @@ setptr(ibuf) (void)sprintf(linebuf, "%s/mail.XXXXXX", tmpdir); if ((c = mkstemp(linebuf)) == -1 || (mestmp = Fdopen(c, "r+")) == NULL) { - (void)fprintf(stderr, "mail: can't open %s\n", linebuf); - exit(1); + errx(1, "can't open %s", linebuf); } (void)unlink(linebuf); @@ -194,7 +193,7 @@ setinput(mp) fflush(otf); if (fseek(itf, (long)positionof(mp->m_block, mp->m_offset), 0) < 0) { perror("fseek"); - panic("temporary file seek"); + panic("Temporary file seek"); } return (itf); } diff --git a/usr.bin/mail/temp.c b/usr.bin/mail/temp.c index 0690027f84bbb..37f6026a21b50 100644 --- a/usr.bin/mail/temp.c +++ b/usr.bin/mail/temp.c @@ -32,11 +32,15 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)temp.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include "rcv.h" -#include <errno.h> +#include <err.h> #include "extern.h" /* @@ -62,10 +66,8 @@ tinit() tmpdir = _PATH_TMP; else { len = strlen(tmpdir); - if ((cp = malloc(len + 2)) == NULL) { - (void)fprintf(stderr, "mail: %s\n", strerror(errno)); - exit (1); - } + if ((cp = malloc(len + 2)) == NULL) + err(1, NULL); (void)strcpy(cp, tmpdir); cp[len] = '/'; cp[len + 1] = '\0'; |
