From 0c16fd32cca2a79000850e2bf71719145f42ca2f Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 14 Jan 2005 15:49:05 +0000 Subject: Improve readability for the recently introduced changes by having their sizeof(*p) instead of explicitlly specifying their types. Suggested by: nectar --- sbin/ldconfig/ldconfig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sbin') diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 8f5fb91..b328bde 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -495,8 +495,8 @@ buildhints() warn("%s", hints_file); return -1; } - if (write(fd, blist, hdr.hh_nbucket * sizeof(struct hints_bucket)) != - (ssize_t)(hdr.hh_nbucket * sizeof(struct hints_bucket))) { + if (write(fd, blist, hdr.hh_nbucket * sizeof(*blist)) != + (ssize_t)(hdr.hh_nbucket * sizeof(*blist))) { warn("%s", hints_file); return -1; } @@ -585,11 +585,11 @@ readhints() if (rescan) return 0; - blist = malloc(sizeof(struct hints_bucket) * hdr->hh_nbucket); + blist = malloc(sizeof(*blist) * hdr->hh_nbucket); if (blist == NULL) err(1, "readhints"); memcpy(blist, (char *)addr + hdr->hh_hashtab, - sizeof(struct hints_bucket) * hdr->hh_nbucket); + sizeof(*blist) * hdr->hh_nbucket); for (i = 0; i < hdr->hh_nbucket; i++) { -- cgit v1.1