diff options
author | Brian Cameron <brian.cameron@sun.com> | 2007-07-30 18:14:03 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2007-07-30 18:14:03 +0000 |
commit | ae14dc68a151eb1e48f640302f3cbbaf2990dabd (patch) | |
tree | bf8a4ca8b23778ab838e7773986cc03d97166658 /common | |
parent | ae412aef849f2a0aae744c752f8c807b8fcc1732 (diff) | |
download | gdm-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.c | 14 |
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; } |