aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/paste
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-05-17 05:11:07 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-05-17 05:11:07 +0000
commit47bca8b02cf7a0e85f952078ac29699abfd0891a (patch)
treecf78d7652b64bccf0e61a4cef6f041a454a5bc4c /usr.bin/paste
parent03083777d91b03f227eaa9003c00d29751c35249 (diff)
downloadsrc-47bca8b02cf7a0e85f952078ac29699abfd0891a.tar.gz
src-47bca8b02cf7a0e85f952078ac29699abfd0891a.zip
Clean up malloc(3)'s argument. Remove casts which do nothing when we're
using sizeof() anyway. Use slightly more consistent (per-file) error reporting for malloc(3) returning NULL. If "malloc failed" was being printed, don't use err(3). If a NULL format is being used, use err(3). In one case errx(3) was being used with strerror(3), so just use err(3).
Notes
Notes: svn path=/head/; revision=96785
Diffstat (limited to 'usr.bin/paste')
-rw-r--r--usr.bin/paste/paste.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index a910a362b45e..ea75288a6ca9 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -122,8 +122,8 @@ parallel(char **argv)
char buf[_POSIX2_LINE_MAX + 1];
for (cnt = 0, head = NULL; (p = *argv); ++argv, ++cnt) {
- if (!(lp = (LIST *)malloc((u_int)sizeof(LIST))))
- errx(1, "%s", strerror(ENOMEM));
+ if ((lp = malloc(sizeof(LIST))) == NULL)
+ err(1, NULL);
if (p[0] == '-' && !p[1])
lp->fp = stdin;
else if (!(lp->fp = fopen(p, "r")))