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 | |
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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | common/gdm-common.c | 14 | ||||
-rw-r--r-- | gui/gdmsetup.c | 3 |
3 files changed, 17 insertions, 7 deletions
@@ -1,5 +1,12 @@ 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. + +2007-07-30 Brian Cameron <brian.cameron@sun.com> + * daemon/slave.c: Rename login to login_user to avoid problem on FreeBSD with symbol conflict since their utmp code needs to call a function called login. Partially fixes #456697. 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; } diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c index 7922dbc1..46fbf206 100644 --- a/gui/gdmsetup.c +++ b/gui/gdmsetup.c @@ -4203,7 +4203,8 @@ strings_list_remove (char *strings_list, const char *string, const char *sep) msg = g_string_new (""); actions = g_strsplit (strings_list, sep, -1); - for (i = 0; actions != NULL && actions[i] != NULL; i++) { + g_assert (actions != NULL); + for (i = 0; actions[i] != NULL; i++) { if (strncmp (actions[i], string, strlen (string)) == 0) continue; g_string_append_printf (msg, "%s%s", separator, actions[i]); |