projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace mh_xmalloc() with mh_xcalloc()
[mmh]
/
uip
/
new.c
diff --git
a/uip/new.c
b/uip/new.c
index
cb16dea
..
9774729
100644
(file)
--- a/
uip/new.c
+++ b/
uip/new.c
@@
-187,9
+187,9
@@
check_folder(char *folder, size_t len, struct list_state *b)
if (is_cur || msgnums != NULL) {
if (*b->first == NULL) {
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 {
} 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;
b->node = b->node->n_next;
}
b->node->n_name = folder;
@@
-280,7
+280,7
@@
join_sequences(char *sequences[])
for (i = 0; sequences[i] != NULL; i++) {
len += strlen(sequences[i]) + 1;
}
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]);
for (i = 0, cp = result; sequences[i] != NULL; i++, cp += len + 1) {
len = strlen(sequences[i]);