summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2009-09-11 11:51:21 (GMT)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2009-09-11 11:51:21 (GMT)
commit3cec11efff953a853e95eeb22e01392fb7db579e (patch)
tree6226b430eeb0e1c5036ab7567608506420ee527c
parent87a855e674513e88bd5edff59c01683db22b6cd6 (diff)
downloadtelepathy-mission-control-3cec11efff953a853e95eeb22e01392fb7db579e.tar.gz
telepathy-mission-control-3cec11efff953a853e95eeb22e01392fb7db579e.tar.xz
mcd_debug_init: use G_N_ELEMENTS to count debug keys
-rw-r--r--src/mcd-debug.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mcd-debug.c b/src/mcd-debug.c
index 5a36355..201a57b 100644
--- a/src/mcd-debug.c
+++ b/src/mcd-debug.c
@@ -137,12 +137,8 @@ void mcd_debug_init ()
* telepathy-glib-style flags-word */
if (level == 0)
{
- guint nkeys;
-
- /* count the debug keys */
- for (nkeys = 0; keys[nkeys].value != 0; nkeys++) /* do nothing */ ;
-
- categories = g_parse_debug_string (mc_debug_str, keys, nkeys);
+ categories = g_parse_debug_string (mc_debug_str, keys,
+ G_N_ELEMENTS (keys) - 1);
tp_debug_set_flags (mc_debug_str);
/* mcd-debug.h uses the value of mcd_debug_level directly, so