summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2007-07-30 18:14:03 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-07-30 18:14:03 +0000
commitae14dc68a151eb1e48f640302f3cbbaf2990dabd (patch)
treebf8a4ca8b23778ab838e7773986cc03d97166658 /common
parentae412aef849f2a0aae744c752f8c807b8fcc1732 (diff)
downloadgdm-ae14dc68a151eb1e48f640302f3cbbaf2990dabd.tar.gz
Now use g_strv_length to calculate the array size. Use an assert to check
2007-07-30 Brian Cameron <brian.cameron@sun.com> * common/gdm-common.c: Now use g_strv_length to calculate the array size. * gui/gdmsetup.c: Use an assert to check that the array is not NULL before the loop rather than in the loop. svn path=/trunk/; revision=5095
Diffstat (limited to 'common')
-rw-r--r--common/gdm-common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/common/gdm-common.c b/common/gdm-common.c
index 0032ef5d..ab4c94f1 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -292,11 +292,13 @@ ve_locale_exists (const char *loc)
int
gdm_vector_len (char * const *v)
{
- int i;
- if (v == NULL)
- return 0;
- for (i = 0; v[i] != NULL; i++)
- ;
- return i;
+ int i;
+
+ if (v == NULL)
+ return 0;
+
+ i = g_strv_length (v);
+
+ return i;
}