Use g_list_first() to find the first element in the list.
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 13 Oct 2011 20:13:52 +0000 (20:13 +0000)
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 13 Oct 2011 20:13:52 +0000 (20:13 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39409 f5534014-38df-0310-8fa8-9805f1628bb7

filters.c

index 6ed7751dea230c65e55dd3e4da9ad9b143a2f657..d2c63f711186640a27e9dbe340ec5b98faa8f1d2 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -582,8 +582,6 @@ void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type)
 
     flpp_dest = get_filter_list(dest_type);
     flpp_src = get_filter_list(src_type);
 
     flpp_dest = get_filter_list(dest_type);
     flpp_src = get_filter_list(src_type);
-    flp_src = *flpp_src;
-
     /* throw away the "old" destination list - a NULL list is ok here */
     while(*flpp_dest) {
         *flpp_dest = remove_filter_entry(*flpp_dest, g_list_first(*flpp_dest));
     /* throw away the "old" destination list - a NULL list is ok here */
     while(*flpp_dest) {
         *flpp_dest = remove_filter_entry(*flpp_dest, g_list_first(*flpp_dest));
@@ -591,11 +589,10 @@ void copy_filter_list(filter_list_type_t dest_type, filter_list_type_t src_type)
     g_assert(g_list_length(*flpp_dest) == 0);
 
     /* copy the list entries */
     g_assert(g_list_length(*flpp_dest) == 0);
 
     /* copy the list entries */
-    while(flp_src) {
+    for(flp_src = g_list_first(*flpp_src); flp_src; flp_src = g_list_next(flp_src)) {
         filt = (filter_def *)(flp_src->data);
 
         *flpp_dest = add_filter_entry(*flpp_dest, filt->name, filt->strval);
         filt = (filter_def *)(flp_src->data);
 
         *flpp_dest = add_filter_entry(*flpp_dest, filt->name, filt->strval);
-        flp_src = g_list_next(flp_src);
     }
 }
 
     }
 }