projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
muttlib.c
diff --git
a/muttlib.c
b/muttlib.c
index
94c7816
..
c52c58b
100644
(file)
--- a/
muttlib.c
+++ b/
muttlib.c
@@
-214,19
+214,25
@@
void mutt_free_parameter (PARAMETER ** p)
*p = 0;
}
*p = 0;
}
-LIST *mutt_add_list (LIST * head, const char *data)
-{
+LIST *mutt_add_list (LIST * head, const char *data) {
+ size_t len = mutt_strlen (data);
+ return (mutt_add_list_n (head, data, len ? len + 1 : 0));
+}
+
+LIST *mutt_add_list_n (LIST *head, const void *data, size_t len) {
LIST *tmp;
for (tmp = head; tmp && tmp->next; tmp = tmp->next);
LIST *tmp;
for (tmp = head; tmp && tmp->next; tmp = tmp->next);
+
if (tmp) {
tmp->next = safe_malloc (sizeof (LIST));
tmp = tmp->next;
if (tmp) {
tmp->next = safe_malloc (sizeof (LIST));
tmp = tmp->next;
- }
- else
+ } else
head = tmp = safe_malloc (sizeof (LIST));
head = tmp = safe_malloc (sizeof (LIST));
- tmp->data = safe_strdup (data);
+ tmp->data = safe_malloc (len);
+ if (len)
+ memcpy (tmp->data, data, len);
tmp->next = NULL;
return head;
}
tmp->next = NULL;
return head;
}