diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-10-25 11:43:30 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-10-25 11:43:30 +0000 |
commit | 1bf35eeccc8c59ed9874cb96348966da281b0853 (patch) | |
tree | a19835aec094d07536c6def639d5d5d236f0a1cd /epan/dissectors/packet-dns.c | |
parent | f2743805ede691924d8f265a2e8ee489116370fb (diff) |
From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30691 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dns.c')
-rw-r--r-- | epan/dissectors/packet-dns.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index c073004b67..cdfb874ef8 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -582,14 +582,10 @@ dns_type_description (guint type) }; const char *short_name; const char *long_name; -#define MAX_STRBUF_LEN 1024 - char *strbuf; - strbuf=ep_alloc(MAX_STRBUF_LEN); short_name = dns_type_name(type); if (short_name == NULL) { - g_snprintf(strbuf, MAX_STRBUF_LEN, "Unknown (%u)", type); - return strbuf; + return ep_strdup_printf("Unknown (%u)", type); } if (type < sizeof(type_names)/sizeof(type_names[0])) long_name = type_names[type]; @@ -627,10 +623,9 @@ dns_type_description (guint type) } if (long_name != NULL) - g_snprintf(strbuf, MAX_STRBUF_LEN, "%s (%s)", short_name, long_name); + return ep_strdup_printf("%s (%s)", short_name, long_name); else - g_snprintf(strbuf, MAX_STRBUF_LEN, "%s", short_name); - return strbuf; + return ep_strdup(short_name); } static const value_string dns_classes[] = { |