Use sizeof more consistently.
This commit is contained in:
parent
e6182307e8
commit
807c941c90
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60190
@ -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);
|
||||
|
@ -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 @@ fetchParseURL(char *URL)
|
||||
/* 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();
|
||||
|
Loading…
Reference in New Issue
Block a user