aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-19 06:28:38 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-19 06:28:38 +0800
commit8eb6a561ab9013d3ad12599176c077c57f12ce08 (patch)
tree8b7076b92b3c63ce6df9eab0d824f88e1952c011 /addressbook/backend
parent4c08e67f41a8069264343daa052002dc4e9de822 (diff)
downloadgsoc2013-evolution-8eb6a561ab9013d3ad12599176c077c57f12ce08.tar.gz
gsoc2013-evolution-8eb6a561ab9013d3ad12599176c077c57f12ce08.tar.zst
gsoc2013-evolution-8eb6a561ab9013d3ad12599176c077c57f12ce08.zip
Fixed e_card_name_copy and e_card_arbitrary_copy to deal correctly with a
2000-05-18 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card.c: Fixed e_card_name_copy and e_card_arbitrary_copy to deal correctly with a passed NULL. * contact-editor/Makefile.am: Removed imagesdir stuff. * contact-editor/arrow.png: Made this transparent. * contact-editor/contact-editor.glade, contact-editor/e-contact-editor-strings.h: Renamed some widgets and added custom widgets for all of the images. * contact-editor/e-contact-editor.c: Worked on making this work decently well with messed up glade files. Cleaned up a lot of code. svn path=/trunk/; revision=3121
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index eb453950da..b07723073f 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -1172,15 +1172,18 @@ e_card_name_free(ECardName *name)
ECardName *
e_card_name_copy(const ECardName *name)
{
- ECardName *newname = g_new(ECardName, 1);
-
- newname->prefix = g_strdup(name->prefix);
- newname->given = g_strdup(name->given);
- newname->additional = g_strdup(name->additional);
- newname->family = g_strdup(name->family);
- newname->suffix = g_strdup(name->suffix);
+ if (name) {
+ ECardName *newname = g_new(ECardName, 1);
+
+ newname->prefix = g_strdup(name->prefix);
+ newname->given = g_strdup(name->given);
+ newname->additional = g_strdup(name->additional);
+ newname->family = g_strdup(name->family);
+ newname->suffix = g_strdup(name->suffix);
- return newname;
+ return newname;
+ } else
+ return NULL;
}
char *
@@ -1231,11 +1234,14 @@ e_card_arbitrary_new(void)
ECardArbitrary *
e_card_arbitrary_copy(const ECardArbitrary *arbitrary)
{
- ECardArbitrary *arb_copy = g_new(ECardArbitrary, 1);
- arb_copy->key = g_strdup(arbitrary->key);
- arb_copy->type = g_strdup(arbitrary->type);
- arb_copy->value = g_strdup(arbitrary->value);
- return arb_copy;
+ if (arbitrary) {
+ ECardArbitrary *arb_copy = g_new(ECardArbitrary, 1);
+ arb_copy->key = g_strdup(arbitrary->key);
+ arb_copy->type = g_strdup(arbitrary->type);
+ arb_copy->value = g_strdup(arbitrary->value);
+ return arb_copy;
+ } else
+ return NULL;
}
void