[ekiga] Modified a loop to prevent a cppchecker error



commit baaddccc246d0528f54cd5e951e99029d1396109
Author: Snark <jpuydt gnome org>
Date:   Sun Jan 2 20:53:21 2011 +0100

    Modified a loop to prevent a cppchecker error
    
    We didn't leak it at all, but since it was complaining, I made the code
    more obviously right -- now it's happy

 lib/gmconf/gmconf-glib.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/lib/gmconf/gmconf-glib.c b/lib/gmconf/gmconf-glib.c
index 8438cf1..4374121 100644
--- a/lib/gmconf/gmconf-glib.c
+++ b/lib/gmconf/gmconf-glib.c
@@ -1043,7 +1043,7 @@ database_notify_on_namespace (DataBase *db,
 {
   GmConfEntry *parent_entry = NULL, *entry = NULL;
   gchar *key = NULL;
-
+  gchar* key_ptr = NULL;
 
   g_return_if_fail (db != NULL);
   g_return_if_fail (namespac != NULL);
@@ -1053,10 +1053,11 @@ database_notify_on_namespace (DataBase *db,
 
   g_return_if_fail (entry != NULL);
 
-  for (key = g_strdup (namespac);
-       key[0] != 0;
-       g_strrstr (key, "/")[0] = 0) {
-    parent_entry = database_get_entry_for_key (db, key);
+  key = g_strdup (namespac);
+  for (key_ptr = key;
+       key_ptr[0] != 0;
+       g_strrstr (key_ptr, "/")[0] = 0) {
+    parent_entry = database_get_entry_for_key (db, key_ptr);
     if (parent_entry != NULL) {
       if (entry_get_type (parent_entry) == GM_CONF_OTHER)
 	entry_set_redirect (parent_entry, entry);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]