From 0dc9fb3d4ab00d14bf45c597471e10e601efd4d4 Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Mon, 8 Aug 2005 18:50:39 +0000 Subject: 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 --- epan/dissectors/packet-pim.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'epan/dissectors/packet-pim.c') 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" : "", -- cgit v1.2.3