initialize value to NULL so that if the field is unknown (meaning we
authorChris Toshok <toshok@ximian.com>
Mon, 29 Dec 2003 19:54:49 +0000 (19:54 +0000)
committerChris Toshok <toshok@src.gnome.org>
Mon, 29 Dec 2003 19:54:49 +0000 (19:54 +0000)
2003-12-29  Chris Toshok  <toshok@ximian.com>

* libebook/e-contact.c (e_contact_get): initialize value to NULL
so that if the field is unknown (meaning we haven't gotten around
to implementing it yet, like the category list stuff), we don't
return an invalid pointer.

addressbook/ChangeLog
addressbook/libebook/e-contact.c

index 9015540..bb07f97 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-29  Chris Toshok  <toshok@ximian.com>
+
+       * libebook/e-contact.c (e_contact_get): initialize value to NULL
+       so that if the field is unknown (meaning we haven't gotten around
+       to implementing it yet, like the category list stuff), we don't
+       return an invalid pointer.
+
 2003-12-19  Chris Toshok  <toshok@ximian.com>
 
        * libebook/e-vcard.h: add lots more #defines, some EVC_X ones for
index 82e8147..f87bafe 100644 (file)
@@ -1192,7 +1192,7 @@ e_contact_field_id (const char *field_name)
 gpointer
 e_contact_get (EContact *contact, EContactField field_id)
 {
-       gpointer value;
+       gpointer value = NULL;
 
        g_return_val_if_fail (contact && E_IS_CONTACT (contact), NULL);
        g_return_val_if_fail (field_id >= 1 && field_id <= E_CONTACT_FIELD_LAST, NULL);