aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ospf.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2012-10-11 19:39:32 +0000
committerBill Meier <wmeier@newsguy.com>2012-10-11 19:39:32 +0000
commit82d40100d2ee06d520158e1c4de4262d3ad9a7b8 (patch)
tree52e3c0313c9fe57de85dd47a22a60b70338e69e0 /epan/dissectors/packet-ospf.c
parentad0219d033baa2db7e7ae2361cbf346205878591 (diff)
Change 'for (i=1; i<=n;...' to 'for (i=0; i<n; ...)'
Done on general principles altho upon inspection none of the cases changed would have actually resulted in an infinite loop. svn path=/trunk/; revision=45478
Diffstat (limited to 'epan/dissectors/packet-ospf.c')
-rw-r--r--epan/dissectors/packet-ospf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 4309ce4605..89fb121423 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -2655,7 +2655,7 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
/* nr_links links follow
* maybe we should put each of the links into its own subtree ???
*/
- for (link_counter = 1; link_counter <= nr_links; link_counter++) {
+ for (link_counter = 0; link_counter < nr_links; link_counter++) {
proto_tree *ospf_lsa_router_link_tree;
proto_item *ti_local;
@@ -2727,7 +2727,7 @@ dissect_ospf_v2_lsa(tvbuff_t *tvb, int offset, proto_tree *tree,
* According to RFC4915 the TOS metrics was never deployed and was subsequently deprecated,
* but decoding still present because MT-ID use the same structure.
*/
- for (metric_counter = 1; metric_counter <= nr_metric; metric_counter++) {
+ for (metric_counter = 0; metric_counter < nr_metric; metric_counter++) {
proto_tree_add_text(ospf_lsa_router_link_tree, tvb, offset, 4, "%s: %u, Metric: %u",
metric_type_str,
tvb_get_guint8(tvb, offset),