dftype = LOCALHOST;
}
- mp = (struct mailname *) mh_xcalloc((size_t) 1, sizeof(*mp));
+ mp = mh_xcalloc(1, sizeof(*mp));
if (mp == NULL) {
if (eresult)
strcpy(eresult, "insufficient memory to represent address");
/* allocate initial space for pointers on first call */
if (!broken) {
len = NUMBROKEN;
- broken = (char **)mh_xcalloc((size_t)len, sizeof(*broken));
+ broken = mh_xcalloc(len, sizeof(*broken));
}
/*
/* enlarge pointer array, if necessary */
if (i >= len) {
len += NUMBROKEN;
- broken = mh_xrealloc(broken,
- (size_t)(len * sizeof(*broken)));
+ broken = mh_xrealloc(broken, len * sizeof(*broken));
}
/* handle separators */
** If list is emtpy, allocate head of profile/context list.
*/
if (!m_defs) {
- m_defs = (struct node *) mh_xcalloc(1, sizeof(*np));
+ m_defs = mh_xcalloc(1, sizeof(*np));
np = m_defs;
np->n_name = getcpy(key);
/*
** Else add this new entry at the end
*/
- np->n_next = (struct node *) mh_xcalloc(1, sizeof(*np));
+ np->n_next = mh_xcalloc(1, sizeof(*np));
np = np->n_next;
np->n_name = getcpy(key);
/* Add new component to the hash table */
#define NEWCOMP(cm,name) do { \
- cm = ((struct comp *) mh_xcalloc(1, sizeof (struct comp)));\
+ cm = (mh_xcalloc(1, sizeof (struct comp)));\
cm->c_name = name;\
ncomp++;\
i = CHASH(name);\
i = strlen(fstring)/2 + 1;
if (i == 1)
i++;
- next_fp = formatvec = (struct format *)mh_xcalloc((size_t) i,
- sizeof(struct format));
+ next_fp = formatvec = mh_xcalloc(i, sizeof(struct format));
if (next_fp == NULL)
adios(EX_OSERR, NULL, "unable to allocate format storage");
if (cm->c_type & CT_ADDR) {
CERROR("component used as both date and address");
}
- cm->c_tws = (struct tws *)
- mh_xcalloc((size_t) 1, sizeof(*cm->c_tws));
+ cm->c_tws = mh_xcalloc(1, sizeof(*cm->c_tws));
fp->f_type = preprocess;
PUTCOMP(sp);
cm->c_type |= CT_DATE;
if (fstat(fileno(fp), &st) == -1) {
adios(EX_IOERR, form, "unable to stat format file");
}
- formats = mh_xcalloc((size_t) st.st_size + 1, sizeof(char));
+ formats = mh_xcalloc(st.st_size + 1, sizeof(char));
if (read(fileno(fp), formats, (int)st.st_size) != st.st_size) {
adios(EX_IOERR, form, "error reading format file");
}
if (fstat(fileno(fp), &st) == -1) {
adios(EX_IOERR, def_form, "unable to stat format file");
}
- formats = mh_xcalloc((size_t) st.st_size + 1, sizeof(char));
+ formats = mh_xcalloc(st.st_size + 1, sizeof(char));
if (read(fileno(fp), formats, (int)st.st_size) != st.st_size) {
adios(EX_IOERR, def_form, "error reading format file");
}
if (use_iconv) {
saveq = q;
savedstlen = dstlen;
- q = convbuf = (char *) mh_xcalloc(endofmime - startofmime, sizeof(char));
+ q = convbuf = mh_xcalloc(endofmime - startofmime, sizeof(char));
}
/*
** ADDCHR2 is for adding characters when q is or might be convbuf:
}
/* Allocate the main structure for folder information */
- mp = (struct msgs *) mh_xcalloc(1, (size_t) sizeof(*mp));
+ mp = mh_xcalloc(1, sizeof(*mp));
clear_folder_flags(mp);
mp->foldpath = name;
** name of the messages in this folder.
*/
len = NUMMSGS;
- mi = (int *) mh_xcalloc((size_t) len, sizeof(*mi));
+ mi = mh_xcalloc(len, sizeof(*mi));
while ((dp = readdir(dd))) {
if ((msgnum = m_atoi(dp->d_name)) && msgnum > 0) {
*/
if (mp->nummsg >= len) {
len += NUMMSGS;
- mi = (int *) mh_xrealloc(mi, (size_t) (len * sizeof(*mi)));
+ mi = mh_xrealloc(mi, len * sizeof(*mi));
}
/* Check if this is the first message we've seen */
n++;
}
- arguments = (char **) mh_xcalloc(argc + n, sizeof(*arguments));
+ arguments = mh_xcalloc(argc + n, sizeof(*arguments));
bp = arguments;
/* Copy any arguments from profile/context */
cp = mh_xcalloc(len, sizeof(char));
memcpy(cp, str, len);
} else {
- cp = mh_xcalloc((size_t) 1, sizeof(char));
+ cp = mh_xcalloc(1, sizeof(char));
*cp = '\0';
}
return cp;
struct lock *lp;
size_t len;
- lp = (struct lock *) mh_xcalloc(1, sizeof(*lp));
+ lp = mh_xcalloc(1, sizeof(*lp));
len = strlen(curlock) + 1;
lp->l_fd = fd;
continue;
}
c = strlen(delimstr);
- fdelim = (unsigned char *) mh_xcalloc((size_t) (c + 3), sizeof(char));
+ fdelim = mh_xcalloc(c + 3, sizeof(char));
*fdelim++ = '\0';
*fdelim = '\n';
msg_delim = (char *)fdelim+1;
** separator) or the last char (since the matchc would have found it
** if it was a real delim).
*/
- pat_map = (unsigned char **) mh_xcalloc(256, sizeof(unsigned char *));
+ pat_map = mh_xcalloc(256, sizeof(unsigned char *));
for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
pat_map[(unsigned char)*cp] = (unsigned char *) cp;
for(;;)
pause();
}
- p = mh_xcalloc((size_t) (strlen(s) + 2), sizeof(char));
+ p = mh_xcalloc(strlen(s) + 2, sizeof(char));
strcpy(p, s);
return p;
}
int i;
char **ep, **nep, *cp;
- cp = mh_xcalloc((size_t) (strlen(name) + strlen(value) + 2), sizeof(char));
+ cp = mh_xcalloc(strlen(name) + strlen(value) + 2, sizeof(char));
sprintf(cp, "%s=%s", name, value);
return 0;
}
- nep = (char **) mh_xcalloc((size_t) (i + 2), sizeof(*nep));
+ nep = mh_xcalloc(i + 2, sizeof(*nep));
for (ep = environ, i = 0; *ep; nep[i++] = *ep++)
continue;
ib)) {
case FLD:
case FLDPLUS:
- np = (struct node *) mh_xcalloc(1, sizeof(*np));
+ np = mh_xcalloc(1, sizeof(*np));
*npp = np;
*(npp = &np->n_next) = NULL;
np->n_name = getcpy(name);
/* On first invocation, allocate initial buffer space */
if (!buffer) {
len = MAXBUFFER;
- buffer = mh_xcalloc((size_t) len, sizeof(char));
+ buffer = mh_xcalloc(len, sizeof(char));
}
/*
char *newbuf;
len += MAXBUFFER;
- newbuf = mh_xrealloc(buffer, (size_t) len);
+ newbuf = mh_xrealloc(buffer, len);
bp = newbuf + (bp - buffer);
buffer = newbuf;
}
/* Some non-POSIX realloc()s don't cope with realloc(NULL,sz) */
if (!ptr) {
- return mh_xcalloc((size_t) 1, size);
+ return mh_xcalloc(1, size);
}
if (size == 0) {
adios(EX_SOFTWARE, NULL, "Tried to realloc 0 bytes");
static char *pp = NULL;
if (pp == NULL)
- pp = mh_xcalloc((size_t) (len = BUFSIZ), sizeof(char));
+ pp = mh_xcalloc(len = BUFSIZ, sizeof(char));
for (ep = (cp = pp) + len - 1;;) {
if (fgets(cp, ep - cp + 1, in) == NULL) {
if (cp >= ep) {
int curlen = cp - pp;
- dp = mh_xrealloc(pp, (size_t) (len += BUFSIZ));
+ dp = mh_xrealloc(pp, len += BUFSIZ);
cp = dp + curlen;
ep = (pp = dp) + len - 1;
}
if (strcmp(pp, ad->ad_text)==0)
return;
- ad = (struct adr *) mh_xcalloc(1, sizeof(*ad));
+ ad = mh_xcalloc(1, sizeof(*ad));
ad->ad_text = getcpy(pp);
ad->ad_local = strchr(pp, '@') == NULL;
ad->ad_next = NULL;
{
struct aka *p;
- p = (struct aka *) mh_xcalloc(1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
p->ak_name = getcpy(id);
p->ak_visible = 0;
{
struct home *p;
- p = (struct home *) mh_xcalloc(1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
p->h_name = getcpy(pw->pw_name);
p->h_uid = pw->pw_uid;
}
/* We'll grow this buffer as needed. */
- field = (char *)mh_xcalloc(field_size = 256, sizeof(char));
+ field = mh_xcalloc(field_size = 256, sizeof(char));
make_comp(&comp);
length = strlen(comp); /* Convenience copy. */
break;
}
if (++n >= field_size - 1) {
- field = (char *)mh_xrealloc(field,
- field_size += 256);
+ field = mh_xrealloc(field, field_size += 256);
cp = field + n - 1;
}
}
if ((fp = fdopen(fd, "r")) == NULL) {
adios(EX_IOERR, NULL, "unable to fdopen file.");
}
- field = (char *)mh_xcalloc(field_size, sizeof(char));
+ field = mh_xcalloc(field_size, sizeof(char));
/*
** Copy lines from the input file to the temporary file
}
if (++n >= field_size - 1) {
- field = (char *) mh_xrealloc(field,
- field_size *= 2);
+ field = mh_xrealloc(field, field_size *= 2);
cp = field + n - 1;
}
}
(q = &pq)->pq_next = NULL;
while ((cp = getname(arg))) {
- p = (struct pqpair *) mh_xcalloc((size_t) 1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
if ((mp = getm(cp, NULL, 0, norm, error)) == NULL) {
p->pq_text = getcpy(cp);
p->pq_error = getcpy(error);
exit(EX_SOFTWARE);
seq_setprev(mp); /* set the previous-sequence */
- smsgs = (struct smsg *)
- mh_xcalloc((size_t) (MAXFOLDER + 2), sizeof(*smsgs));
+ smsgs = mh_xcalloc(MAXFOLDER + 2, sizeof(*smsgs));
hi = mp->hghmsg + 1;
/* allocate the initial space to record the folder names */
numfolders = 0;
maxfolders = MAXFOLDERS;
- foldersToDo = (char **) mh_xcalloc((size_t) maxfolders, sizeof(*foldersToDo));
+ foldersToDo = mh_xcalloc(maxfolders, sizeof(*foldersToDo));
/* no sequences yet */
numsequences = 0;
*/
if (numfolders >= maxfolders) {
maxfolders += MAXFOLDERS;
- foldersToDo = (char **) mh_xrealloc(foldersToDo, (size_t) (maxfolders * sizeof(*foldersToDo)));
+ foldersToDo = mh_xrealloc(foldersToDo, maxfolders * sizeof(*foldersToDo));
}
if (*cp == '+' || *cp == '@') {
foldersToDo[numfolders++] = getcpy(expandfol(cp));
AllocFolders(&orders, &nOrdersAlloced, nOrders + 1);
o = &orders[nOrders++];
o->priority = priority++;
- o->name = (char *) mh_xcalloc(p - s + 1, sizeof(char));
+ o->name = mh_xcalloc(p - s + 1, sizeof(char));
strncpy(o->name, s, p - s);
o->name[p - s] = 0;
} else
return;
if (*f == NULL) {
*nfa = 10;
- *f = (struct Folder *) mh_xcalloc(*nfa, sizeof(struct Folder));
+ *f = mh_xcalloc(*nfa, sizeof(struct Folder));
} else {
*nfa *= 2;
- *f = (struct Folder *) mh_xrealloc(
- *f, *nfa * (sizeof(struct Folder)));
+ *f = mh_xrealloc(*f, *nfa * sizeof(struct Folder));
}
}
if ((in = dup(fileno(tmp))) == NOTOK)
adios(EX_OSERR, "dup", "unable to");
- line = mh_xcalloc((unsigned) fmtsize, sizeof(char));
+ line = mh_xcalloc(fmtsize, sizeof(char));
fmt_scan(fmt, line, fmtsize, dat);
fputs(line, tmp);
free(line);
/*
** Allocate space for primary (outside) content
*/
- ct = (CT) mh_xcalloc(1, sizeof(*ct));
+ ct = mh_xcalloc(1, sizeof(*ct));
/*
** Allocate structure for handling decoded content
ct->c_subtype = MULTI_MIXED;
ct->c_file = getcpy(infile);
- m = (struct multipart *) mh_xcalloc(1, sizeof(*m));
+ m = mh_xcalloc(1, sizeof(*m));
ct->c_ctparams = (void *) m;
pp = &m->mp_parts;
if (!p)
continue;
- part = (struct part *) mh_xcalloc(1, sizeof(*part));
+ part = mh_xcalloc(1, sizeof(*part));
*pp = part;
pp = &part->mp_next;
part->mp_part = p;
{
CE ce;
- ce = (CE) mh_xcalloc(1, sizeof(*ce));
+ ce = mh_xcalloc(1, sizeof(*ce));
ct->c_cefile = ce;
ct->c_ceopenfnx = open7Bit; /* since unencoded */
}
/* allocate basic Content structure */
- ct = (CT) mh_xcalloc(1, sizeof(*ct));
+ ct = mh_xcalloc(1, sizeof(*ct));
*ctp = ct;
/* allocate basic structure for handling decoded content */
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_DIGEST;
- m = (struct multipart *) mh_xcalloc(1, sizeof(*m));
+ m = mh_xcalloc(1, sizeof(*m));
ct->c_ctparams = (void *) m;
pp = &m->mp_parts;
CT p;
CE pe;
- p = (CT) mh_xcalloc(1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
init_decoded_content(p);
pe = p->c_cefile;
if (get_ctinfo("message/rfc822", p, 0)
msgnum);
pe->ce_file = getcpy(buffer);
- part = (struct part *) mh_xcalloc(1, sizeof(*part));
+ part = mh_xcalloc(1, sizeof(*part));
*pp = part;
pp = &part->mp_next;
part->mp_part = p;
ct->c_type = CT_MULTIPART;
ct->c_subtype = vrsn;
- m = (struct multipart *) mh_xcalloc(1, sizeof(*m));
+ m = mh_xcalloc(1, sizeof(*m));
ct->c_ctparams = (void *) m;
pp = &m->mp_parts;
if (!p)
continue;
- part = (struct part *) mh_xcalloc(1, sizeof(*part));
+ part = mh_xcalloc(1, sizeof(*part));
*pp = part;
pp = &part->mp_next;
part->mp_part = p;
(q = &pq)->pq_next = NULL;
while ((cp = getname(ap))) {
- p = (struct pqpair *) mh_xcalloc((size_t) 1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
if ((mp = getm(cp, NULL, 0, AD_NAME, error)) == NULL) {
p->pq_text = getcpy(cp);
{
struct mcomp *c1;
- c1 = (struct mcomp *) mh_xcalloc((size_t) 1, sizeof(*c1));
+ c1 = mh_xcalloc(1, sizeof(*c1));
c1->c_flags = flags & ~INIT;
if ((c1->c_name = name ? getcpy(name) : NULL))
** check if message is coming from file
*/
if (file) {
- cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts));
+ cts = mh_xcalloc(2, sizeof(*cts));
ctp = cts;
if ((ct = parse_mime(file)))
}
seq_setprev(mp); /* set the previous-sequence */
- cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
- sizeof(*cts));
+ cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
HF hp;
/* allocate the content structure */
- ct = (CT) mh_xcalloc(1, sizeof(*ct));
+ ct = mh_xcalloc(1, sizeof(*ct));
ct->c_fp = in;
ct->c_file = getcpy(file);
ct->c_subtype = kv->kv_value;
/* allocate text character set structure */
- t = (struct text *) mh_xcalloc(1, sizeof(*t));
+ t = mh_xcalloc(1, sizeof(*t));
ct->c_ctparams = (void *) t;
/* scan for charset parameter */
}
/* allocate primary structure for multipart info */
- m = (struct multipart *) mh_xcalloc(1, sizeof(*m));
+ m = mh_xcalloc(1, sizeof(*m));
ct->c_ctparams = (void *) m;
/* check if boundary parameter contains only whitespace characters */
if (strcmp(buffer + 2, m->mp_start)!=0)
continue;
next_part:
- part = (struct part *) mh_xcalloc(1, sizeof(*part));
+ part = mh_xcalloc(1, sizeof(*part));
*next = part;
next = &part->mp_next;
i++;
/* allocate array of pointers to the parts */
- base = (struct part **) mh_xcalloc((size_t) (i + 1), sizeof(*base));
+ base = mh_xcalloc(i + 1, sizeof(*base));
bmp = base;
/* point at all the parts */
char **ap, **ep;
struct partial *p;
- p = (struct partial *) mh_xcalloc(1, sizeof(*p));
+ p = mh_xcalloc(1, sizeof(*p));
ct->c_ctparams = (void *) p;
/*
{
CE ce;
- ce = (CE) mh_xcalloc(1, sizeof(*ce));
+ ce = mh_xcalloc(1, sizeof(*ce));
ct->c_cefile = ce;
ct->c_ceopenfnx = openfnx;
** check if message is coming from file
*/
if (file) {
- cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts));
+ cts = mh_xcalloc(2, sizeof(*cts));
ctp = cts;
if ((ct = parse_mime(file)))
seq_setprev(mp); /* set the Previous-Sequence */
seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */
- cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
- sizeof(*cts));
+ cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
/*
** check if message is coming from file
*/
if (file) {
- cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts));
+ cts = mh_xcalloc(2, sizeof(*cts));
ctp = cts;
if ((ct = parse_mime(file)))
exit(EX_USAGE);
seq_setprev(mp); /* set the previous-sequence */
- cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
- sizeof(*cts));
+ cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
return NOTOK;
}
- base = (CT *) mh_xcalloc((size_t) (i + 1), sizeof(*base));
+ base = mh_xcalloc(i + 1, sizeof(*base));
ctq = base;
for (ctp = cts; *ctp; ctp++) {
** check if message is coming from file
*/
if (file) {
- cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts));
+ cts = mh_xcalloc(2, sizeof(*cts));
ctp = cts;
if ((ct = parse_mime(file)))
exit(EX_USAGE);
seq_setprev(mp); /* set the previous-sequence */
- cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
- sizeof(*cts));
+ cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
{
struct nexus *p;
- p = (struct nexus *) mh_xcalloc((size_t) 1, sizeof *p);
+ p = mh_xcalloc(1, sizeof *p);
p->n_action = action;
return p;
cp = new_fs(form ? form : rcvdistcomps, NULL);
format_len = strlen(cp);
ncomps = fmt_compile(cp, &fmt) + 1;
- nxtbuf = compbuffers =
- (char **) mh_xcalloc((size_t) ncomps, sizeof(char *));
- savecomp = used_buf =
- (struct comp **) mh_xcalloc((size_t) (ncomps + 1),
- sizeof(struct comp *));
+ nxtbuf = compbuffers = mh_xcalloc(ncomps, sizeof(char *));
+ savecomp = used_buf = mh_xcalloc(ncomps + 1, sizeof(struct comp *));
savecomp += ncomps + 1;
*--savecomp = 0;
finished: ;
i = format_len + char_read + 256;
- scanl = mh_xcalloc((size_t) i + 2, sizeof(char));
+ scanl = mh_xcalloc(i + 2, sizeof(char));
dat[0] = dat[1] = dat[2] = dat[4] = 0;
dat[3] = OUTPUTLINELEN;
fmt_scan(fmt, scanl, i, dat);
/* compile format string */
ncomps = fmt_compile(cp, &fmt) + 1;
- nxtbuf = compbuffers = (char **)
- mh_xcalloc((size_t) ncomps, sizeof(char *));
- savecomp = used_buf = (struct comp **)
- mh_xcalloc((size_t) (ncomps+1), sizeof(struct comp *));
+ nxtbuf = compbuffers = mh_xcalloc(ncomps, sizeof(char *));
+ savecomp = used_buf = mh_xcalloc(ncomps+1, sizeof(struct comp *));
savecomp += ncomps + 1;
*--savecomp = NULL; /* point at zero'd end minus 1 */
}
}
i = format_len + char_read + 256;
- scanl = mh_xcalloc((size_t) i + 2, sizeof(char));
+ scanl = mh_xcalloc(i + 2, sizeof(char));
dat[0] = 0;
dat[1] = 0;
dat[2] = 0;
adios(EX_SOFTWARE, NULL, "more than %d messages for refile exec",
MAXARGS - 6);
}
- vec = (char **)mh_xcalloc((size_t)(msgs.size + 6), sizeof(*vec));
+ vec = mh_xcalloc(msgs.size + 6, sizeof(*vec));
vec[vecp++] = "refile";
vec[vecp++] = "-src";
vec[vecp++] = concat("+", folder, NULL);
width = MAXSCANL;
}
dat[3] = slwidth = width;
- scanl = (char *) mh_xcalloc((size_t)(slwidth + 2),
- SCAN_CHARWIDTH); /* probably for \n and \0 */
+ scanl = mh_xcalloc(slwidth + 2, SCAN_CHARWIDTH); /* probably for \n and \0 */
/* Compile format string */
ncomps = fmt_compile(fmtstr, &fmt) + 1;
FINDCOMP(datecomp, "date");
datecomp = NULL;
}
- nxtbuf = compbuffers = (char **) mh_xcalloc((size_t) ncomps,
- sizeof(char *));
- used_buf = (struct comp **) mh_xcalloc((size_t) (ncomps+1),
- sizeof(struct comp *));
+ nxtbuf = compbuffers = mh_xcalloc(ncomps, sizeof(char *));
+ used_buf = mh_xcalloc(ncomps+1, sizeof(struct comp *));
/* NULL-terminate array */
used_buf += ncomps;
*used_buf = NULL;
if (datecomp && !datecomp->c_text) {
if (!datecomp->c_text) {
if (!datecomp->c_tws)
- datecomp->c_tws = (struct tws *) mh_xcalloc((size_t) 1, sizeof(*datecomp->c_tws));
+ datecomp->c_tws = mh_xcalloc(1, sizeof(*datecomp->c_tws));
if (!datecomp->c_tws)
adios(EX_OSERR, NULL, "unable to allocate tws buffer");
*datecomp->c_tws = *dlocaltime((time_t *) &st.st_mtime);
}
/* We'll grow the buffer as needed. */
- field = (char *)mh_xcalloc(field_size = 256, sizeof(char));
+ field = mh_xcalloc(field_size = 256, sizeof(char));
/*
** Scan the draft file for an attachment header field name.
}
/* We'll grow the buffer as needed. */
- field = (char *)mh_xcalloc(field_size = 256, sizeof(char));
+ field = mh_xcalloc(field_size = 256, sizeof(char));
/* Scan the draft file for an attachment header field name. */
while (get_line() != EOF && *field != '\0' && *field != '-') {
break;
}
if (++n >= field_size - 1) {
- field = (char *)mh_xrealloc(field, field_size += 256);
+ field = mh_xrealloc(field, field_size += 256);
p = field + n - 1;
}
}
/*
** sort a list of pointers to our "messages to be sorted".
*/
- dlist = (struct smsg **) mh_xcalloc((size_t) (nmsgs+1), sizeof(*dlist));
+ dlist = mh_xcalloc(nmsgs+1, sizeof(*dlist));
for (i = 0; i < nmsgs; i++)
dlist[i] = &smsgs[i];
dlist[nmsgs] = 0;
struct smsg **slist, **flist;
struct smsg ***il, **fp, **dp;
- slist = (struct smsg **) mh_xcalloc(nmsgs+1, sizeof(*slist));
+ slist = mh_xcalloc(nmsgs+1, sizeof(*slist));
memcpy((char *)slist, (char *)dlist, (nmsgs+1)*sizeof(*slist));
qsort((char *)slist, nmsgs, sizeof(*slist),
(qsort_comp) subsort);
** the collection of messages with the same subj
** given a message number.
*/
- il = (struct smsg ***) mh_xcalloc(mp->hghsel+1, sizeof(*il));
+ il = mh_xcalloc(mp->hghsel+1, sizeof(*il));
if (! il)
adios(EX_OSERR, NULL, "couldn't allocate msg list");
for (i = 0; i < nmsgs; i++)
** make up the final list, chronological but with
** all the same subjects grouped together.
*/
- flist = (struct smsg **) mh_xcalloc(nmsgs+1, sizeof(*flist));
+ flist = mh_xcalloc(nmsgs+1, sizeof(*flist));
fp = flist;
for (dp = dlist; *dp;) {
struct smsg **s = il[(*dp++)->s_msg];
twscopy(&tb, dlocaltimenow());
- smsgs = (struct smsg *) mh_xcalloc((size_t) (mp->hghsel - mp->lowsel + 2),
- sizeof(*smsgs));
+ smsgs = mh_xcalloc(mp->hghsel - mp->lowsel + 2, sizeof(*smsgs));
s = smsgs;
for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {