From 0109c305458dc8e85d6497c140a58a9fce7df4f3 Mon Sep 17 00:00:00 2001 From: jmallett Date: Fri, 17 May 2002 05:11:07 +0000 Subject: 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). --- usr.bin/finger/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/finger/util.c') diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c index 218b1bf..ec8df2e 100644 --- a/usr.bin/finger/util.c +++ b/usr.bin/finger/util.c @@ -244,7 +244,7 @@ palloc() { PERSON *p; - if ((p = malloc((u_int) sizeof(PERSON))) == NULL) + if ((p = malloc(sizeof(PERSON))) == NULL) err(1, NULL); return(p); } @@ -255,7 +255,7 @@ walloc(pn) { WHERE *w; - if ((w = malloc((u_int) sizeof(WHERE))) == NULL) + if ((w = malloc(sizeof(WHERE))) == NULL) err(1, NULL); if (pn->whead == NULL) pn->whead = pn->wtail = w; -- cgit v1.1