diff options
author | Jörg Mayer <jmayer@loplof.de> | 2006-01-16 07:59:44 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2006-01-16 07:59:44 +0000 |
commit | 1900bf87fc2baf1a4528617090be21deee760131 (patch) | |
tree | ae17681289f1f8a5dedc49668631f2ea79dce8fb /epan/dissectors/packet-ospf.c | |
parent | 5a128e39581b1dd1903e7665cac2468b33786c03 (diff) |
done:
packet-ntp.c: Rather confused and incorrect use of g_snprintf return value
packet-pim.c: whitespace change
packet-icmpv6.c: g_snprintf takes trailing \0 into account, fix off by 1 error
packet-clnp.c: Fix incorrect use of g_snprintf return value
packet-isakmp.c: g_snprintf takes trailing \0 into account
packet-tr.c: Fix incorrect use of g_snprintf return value
packet-radius.c: Fix incorrect use of g_snprintf return value
packet-radius.h: constify a string variable
packet-ldap.c: The return value isn't needed, so don't use it incorrectly
packet-tcp.c: Fix incorrect use of g_snprintf return value
packet-windows-common.c: Remove unneeded DISSECTOR_ASSERT
packet-smb-sidsnooping.c: g_snprintf takes trailing \0 into account
packet-pvfs2.c: g_snprintf takes trailing \0 into account
packet-ptp.c: Remove #include snprintf
packet-ppp.c: Fix incorrect use of g_snprintf return value
packet-ospf.c: Fix incorrect use of g_snprintf return value
packet-mip6.c: snprintf -> g_snprintf
packet-bootp.c: Remove a commented out bad use of g_snprintf
packet-ber.c: snprintf -> g_snprintf, g_snprintf takes trailing \0 into account
2do:
52 packet-ieee80211.c: 2DO
2 packet-nfs.c: 2DO - too many side effects
33 packet-bgp.c: 2DO
18 packet-dns.c: 2DO
14 packet-dcm.c: 2DO
13 packet-x11.c: 2DO
11 packet-kerberos.c: 2DO
10 packet-diameter.c: 2DO
9 packet-snmp.c: 2DO
9 packet-pgm.c: 2DO
7 packet-nbns.c: 2DO
6 packet-fcswils.c: 2DO
5 packet-wccp.c: 2DO
5 packet-cops.c: 2DO
4 packet-wtp.c: 2DO
svn path=/trunk/; revision=17038
Diffstat (limited to 'epan/dissectors/packet-ospf.c')
-rw-r--r-- | epan/dissectors/packet-ospf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c index 988fc6e351..95261f1946 100644 --- a/epan/dissectors/packet-ospf.c +++ b/epan/dissectors/packet-ospf.c @@ -823,9 +823,11 @@ dissect_ospf_bitfield (proto_tree *parent_tree, tvbuff_t *tvb, int offset, proto_tree *tree = NULL; guint32 flags; char *str; - gint length, pos, i; + size_t length, pos; + gint i; header_field_info *hfinfo; int hfindex, index; + size_t returned_length; hfindex = ospf_filter[bfinfo->hfindex]; hfinfo = proto_registrar_get_nth(hfindex); @@ -860,9 +862,10 @@ dissect_ospf_bitfield (proto_tree *parent_tree, tvbuff_t *tvb, int offset, index = ospf_filter[bfinfo->index[i]]; hfinfo = proto_registrar_get_nth(index); if (flags & hfinfo->bitmask) { - pos += g_snprintf(str+pos, MAX_OPTIONS_LEN-pos, "%s%s", + returned_length = g_snprintf(&str[pos], MAX_OPTIONS_LEN-pos, "%s%s", pos ? ", " : "", hfinfo->name); + pos += MIN(returned_length, MAX_OPTIONS_LEN-pos); } proto_tree_add_boolean(tree, index, tvb, offset, length, flags); } |