aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/importers/evolution-ldif-importer.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-10-25 05:55:54 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-10-27 21:25:01 +0800
commit58166e645971a4812fef23702f45cacc8e64e419 (patch)
treebedad70e39e2215a53105e0303c168e86140371a /addressbook/importers/evolution-ldif-importer.c
parentc58b70659747967568a536e217b9440424709f92 (diff)
downloadgsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar.gz
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar.bz2
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar.lz
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar.xz
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.tar.zst
gsoc2013-evolution-58166e645971a4812fef23702f45cacc8e64e419.zip
Prefer G_N_ELEMENTS over sizeof calculations.
Diffstat (limited to 'addressbook/importers/evolution-ldif-importer.c')
-rw-r--r--addressbook/importers/evolution-ldif-importer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index efc4a2bf71..1e6461a631 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -127,7 +127,6 @@ ldif_fields[] = {
{ "nsAIMid", E_CONTACT_IM_AIM, FLAG_LIST },
{ "mozilla_AimScreenName", E_CONTACT_IM_AIM, FLAG_LIST }
};
-static gint num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]);
static GString *
getValue( gchar **src )
@@ -267,7 +266,7 @@ parseLine (LDIFImporter *gci, EContact *contact,
ldif_value = getValue(&value );
field_handled = FALSE;
- for (i = 0; i < num_ldif_fields; i ++) {
+ for (i = 0; i < G_N_ELEMENTS (ldif_fields); i ++) {
if (!g_ascii_strcasecmp (ptr, ldif_fields[i].ldif_attribute)) {
if (ldif_fields[i].flags & FLAG_WORK_ADDRESS) {
populate_contact_address (work_address, ptr, ldif_value->str);