From 0ee0a9878bdb7b86f331fdd3fb15fcc3ccec676d Mon Sep 17 00:00:00 2001 From: des Date: Sun, 7 May 2000 20:02:52 +0000 Subject: Use sizeof more consistently. --- lib/libfetch/common.c | 2 +- lib/libfetch/fetch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libfetch') diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index ed5072c..11b947c 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -223,7 +223,7 @@ _fetch_connect(char *host, int port, int verbose) _fetch_info("connecting to %s:%d", host, port); /* set up socket address structure */ - bzero(&sin, sizeof(sin)); + bzero(&sin, sizeof sin); bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length); sin.sin_family = he->h_addrtype; sin.sin_port = htons(port); diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 3c944a1..bc2f565 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -224,7 +224,7 @@ fetchParseURL(char *URL) int i; /* allocate struct url */ - if ((u = calloc(1, sizeof(struct url))) == NULL) { + if ((u = calloc(1, sizeof *u)) == NULL) { errno = ENOMEM; _fetch_syserr(); return NULL; @@ -284,7 +284,7 @@ nohost: /* document */ if (*p) { struct url *t; - t = realloc(u, sizeof(*u)+strlen(p)-1); + t = realloc(u, sizeof *u + strlen(p) - 1); if (t == NULL) { errno = ENOMEM; _fetch_syserr(); -- cgit v1.1