From: Christian Dywan Date: Fri, 19 Jun 2009 01:06:22 +0000 (+0200) Subject: Use an index to iterate news feeds to avoid compiler warnings X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18fa1d0fa328ab69f60e76be2a9dd94580537c7d;p=midori Use an index to iterate news feeds to avoid compiler warnings --- diff --git a/midori/midori-view.c b/midori/midori-view.c index b0887bc9..44288fad 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -827,12 +827,13 @@ webkit_web_view_load_finished_cb (WebKitWebView* web_view, "f.push (l[i].href + '|' + l[i].title); } return f; }" "feeds (document.getElementsByTagName ('link'))", NULL); gchar** items = g_strsplit (value, ",", 0); - gchar** iter; + guint i = 0; katze_array_clear (view->news_feeds); - for (iter = items; iter && *iter; iter++) + if (items != NULL) + while (items[i] != NULL) { - gchar** parts = g_strsplit (*iter, "|", 2); + gchar** parts = g_strsplit (items[i], "|", 2); KatzeItem* item = g_object_new (KATZE_TYPE_ITEM, "uri", parts ? *parts : "", "name", parts && *parts ? parts[1] : NULL, @@ -840,6 +841,7 @@ webkit_web_view_load_finished_cb (WebKitWebView* web_view, katze_array_add_item (view->news_feeds, item); g_object_unref (item); g_strfreev (parts); + i++; } g_strfreev (items); g_object_set_data (G_OBJECT (view), "news-feeds",