diff options
Diffstat (limited to 'contact.c')
-rw-r--r-- | contact.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contact.c b/contact.c index bc0f8344..79950e80 100644 --- a/contact.c +++ b/contact.c @@ -50,6 +50,20 @@ PContact p_contact_new(const char * const name, const char * const show, return contact; } +PContact p_contact_copy(PContact contact) +{ + PContact copy = malloc(sizeof(struct p_contact_t)); + copy->name = strdup(contact->name); + copy->show = strdup(contact->show); + + if (contact->status != NULL) + copy->status = strdup(contact->status); + else + copy->status = NULL; + + return copy; +} + void p_contact_free(PContact contact) { free(contact->name); |