int j, k;
char *cp, **ap;
- field = getcpy(field);
+ field = mh_xstrdup(field);
/* copied from seq_read.c:seq_init */
for (ap = brkstring(field, " ", "\n"); *ap; ap++) {
}
}
- free(field);
+ mh_free0(&field);
return total;
}
for (state = FLD2;;) {
switch (state = m_getfld2(state, &f, fp)) {
+ case LENERR2:
+ state = FLD2;
+ /* FALL */
+
case FLD2:
/*
** if it's in a sequence we want,
old_msgnums = msgnums;
msgnums = concat(old_msgnums, " ",
this_msgnums,
- (void *)NULL);
- free(old_msgnums);
- free(this_msgnums);
+ NULL);
+ mh_free0(&old_msgnums);
+ mh_free0(&this_msgnums);
}
}
continue;
if (is_cur || msgnums != NULL) {
if (*b->first == NULL) {
- *b->first = b->node = mh_xmalloc(sizeof(*b->node));
+ *b->first = b->node = mh_xcalloc(1, sizeof(*b->node));
} else {
- b->node->n_next = mh_xmalloc(sizeof(*b->node));
+ b->node->n_next = mh_xcalloc(1, sizeof(*b->node));
b->node = b->node->n_next;
}
b->node->n_name = folder;
while (vfgets(fp, &line) == OK) {
len = strlen(line) - 1;
line[len] = '\0';
- check_folder(getcpy(line), len, &b);
+ check_folder(mh_xstrdup(line), len, &b);
}
fclose(fp);
}
for (i = 0; sequences[i] != NULL; i++) {
len += strlen(sequences[i]) + 1;
}
- result = mh_xmalloc(len + 1);
+ result = mh_xcalloc(len + 1, sizeof(char));
for (i = 0, cp = result; sequences[i] != NULL; i++, cp += len + 1) {
len = strlen(sequences[i]);
} else {
unseen = seq_unseen; /* use default */
}
- dp = getcpy(unseen);
+ dp = mh_xstrdup(unseen);
for (ap = brkstring(dp, " ", "\n"); *ap; ap++) {
sequences[i++] = *ap;
}