even if unharmful, this was simply ugly.
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Feb 2005 22:39:03 +0000 (22:39 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Feb 2005 22:39:03 +0000 (22:39 +0000)
change

do {
 if (i == 0) break;
 ...
} while (i);

for a propper

while(i) {
 ...
}

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13557 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-http.c

index 9a8fb9f437eaf495fd233ceb81e3cd768ff2a341..4c257ee826d42eaba4436bb3dcfa9ee7bab69177 100644 (file)
@@ -329,9 +329,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        /* We'll then delete from the array all the stat_infos that do not belong to this frame */ 
        i = stat_infos->len;
-       do {
-               if (i==0) break;
-               
+       while (i) {             
                --i;
                
                si = g_ptr_array_index(stat_infos,i);
@@ -343,7 +341,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        if (si->http_host) g_free(si->http_host);
                        g_free(si);
                }
-       } while (i);
+       }
        
        /* then we'll add the current stat_info to the array */
        g_ptr_array_add(stat_infos,stat_info);