diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2009-04-20 05:49:26 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2009-04-20 05:49:26 +0000 |
commit | 83d7f21cd5ab86143a329c2582e4641b4605c0b9 (patch) | |
tree | b0e416af6bfef51037ad01fac431ac37003a4ed1 /epan/dissectors/packet-cdp.c | |
parent | a6f9c55480f88a7c7f59bec1645d792a02de7ad4 (diff) |
Remove code duplication.
svn path=/trunk/; revision=28091
Diffstat (limited to 'epan/dissectors/packet-cdp.c')
-rw-r--r-- | epan/dissectors/packet-cdp.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c index 8c5d783b2d..37c7a78372 100644 --- a/epan/dissectors/packet-cdp.c +++ b/epan/dissectors/packet-cdp.c @@ -879,7 +879,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Move offset to where the list of Power Available Values Exist */ offset += 8; while(power_avail_len) { - if (power_avail_len > 4) { + if (power_avail_len >= 4) { power_avail = tvb_get_ntohl(tvb, offset); if (tree) { proto_tree_add_text(tlv_tree, tvb, offset, @@ -889,14 +889,6 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) power_avail_len -= 4; offset += 4; } else { - if (power_avail_len == 4) { - power_avail = tvb_get_ntohl(tvb, offset); - if (tree) { - proto_tree_add_text(tlv_tree, tvb, offset, - 4, "Power Available: %u mW", power_avail); - proto_item_append_text(tlvi, "%u mW", power_avail); - } - } offset += power_avail_len; break; } |