diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-08-08 18:50:39 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-08-08 18:50:39 +0000 |
commit | 0dc9fb3d4ab00d14bf45c597471e10e601efd4d4 (patch) | |
tree | ae44175ca8fd23548fcec5833098b535af5e372c /epan/dissectors/packet-pim.c | |
parent | f3407856f4fd97caf90655205cdb2c66991e75ba (diff) | |
download | wireshark-0dc9fb3d4ab00d14bf45c597471e10e601efd4d4.tar.gz wireshark-0dc9fb3d4ab00d14bf45c597471e10e601efd4d4.tar.bz2 wireshark-0dc9fb3d4ab00d14bf45c597471e10e601efd4d4.zip |
various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants
svn path=/trunk/; revision=15264
Diffstat (limited to 'epan/dissectors/packet-pim.c')
-rw-r--r-- | epan/dissectors/packet-pim.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c index ac0408c16e..768c37d51d 100644 --- a/epan/dissectors/packet-pim.c +++ b/epan/dissectors/packet-pim.c @@ -74,14 +74,14 @@ dissect_pimv1_addr(tvbuff_t *tvb, int offset) { flags_masklen = tvb_get_ntohs(tvb, offset); if (flags_masklen & 0x0180) { - (void)snprintf(buf, sizeof(buf), + g_snprintf(buf, sizeof(buf), "(%s%s%s) ", flags_masklen & 0x0100 ? "S" : "", flags_masklen & 0x0080 ? "W" : "", flags_masklen & 0x0040 ? "R" : ""); } else buf[0] = '\0'; - (void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s/%u", + g_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s/%u", ip_to_str(tvb_get_ptr(tvb, offset + 2, 4)), flags_masklen & 0x3f); return buf; @@ -520,13 +520,13 @@ dissect_pim_addr(tvbuff_t *tvb, int offset, enum pimv2_addrtype at, switch (af) { case AFNUM_INET: len = 4; - (void)snprintf(buf, sizeof(buf), "%s", + g_snprintf(buf, sizeof(buf), "%s", ip_to_str(tvb_get_ptr(tvb, offset + 2, len))); break; case AFNUM_INET6: len = 16; - (void)snprintf(buf, sizeof(buf), "%s", + g_snprintf(buf, sizeof(buf), "%s", ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset + 2, len))); break; } @@ -539,13 +539,13 @@ dissect_pim_addr(tvbuff_t *tvb, int offset, enum pimv2_addrtype at, switch (af) { case AFNUM_INET: len = 4; - (void)snprintf(buf, sizeof(buf), "%s/%u", + g_snprintf(buf, sizeof(buf), "%s/%u", ip_to_str(tvb_get_ptr(tvb, offset + 4, len)), mask_len); break; case AFNUM_INET6: len = 16; - (void)snprintf(buf, sizeof(buf), "%s/%u", + g_snprintf(buf, sizeof(buf), "%s/%u", ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset + 4, len)), mask_len); break; } @@ -559,18 +559,18 @@ dissect_pim_addr(tvbuff_t *tvb, int offset, enum pimv2_addrtype at, switch (af) { case AFNUM_INET: len = 4; - (void)snprintf(buf, sizeof(buf), "%s/%u", + g_snprintf(buf, sizeof(buf), "%s/%u", ip_to_str(tvb_get_ptr(tvb, offset + 4, len)), mask_len); break; case AFNUM_INET6: len = 16; - (void)snprintf(buf, sizeof(buf), "%s/%u", + g_snprintf(buf, sizeof(buf), "%s/%u", ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset + 4, len)), mask_len); break; } if (flags) { - (void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + g_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " (%s%s%s)", flags & 0x04 ? "S" : "", flags & 0x02 ? "W" : "", |