aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fclctl.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-10-25 11:43:30 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-10-25 11:43:30 +0000
commit88bb44a51e350c9749323242482dc5e944697d8f (patch)
treea19835aec094d07536c6def639d5d5d236f0a1cd /epan/dissectors/packet-fclctl.c
parent337896f4c6777bc0b84a2e017ebcbb52100a312b (diff)
From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=30691
Diffstat (limited to 'epan/dissectors/packet-fclctl.c')
-rw-r--r--epan/dissectors/packet-fclctl.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/epan/dissectors/packet-fclctl.c b/epan/dissectors/packet-fclctl.c
index 17999a2d99..96ce9e83f0 100644
--- a/epan/dissectors/packet-fclctl.c
+++ b/epan/dissectors/packet-fclctl.c
@@ -136,29 +136,22 @@ fclctl_get_typestr (guint8 linkctl_type, guint8 type)
(linkctl_type == FC_LCTL_FBSYL)) {
return (val_to_str ((type & 0xF0), fc_lctl_fbsy_val, "0x%x"));
}
- else return ("\0");
+ return "";
}
-gchar *
+const gchar *
fclctl_get_paramstr (guint32 linkctl_type, guint32 param)
{
- gchar *errstr;
-
-#define MAX_ERRSTR_LEN 64
- errstr=ep_alloc(MAX_ERRSTR_LEN);
- errstr[0] = '\0';
-
if (linkctl_type == FC_LCTL_PBSY) {
- g_snprintf(errstr, MAX_ERRSTR_LEN, "%s, %s",
+ return g_strdup_printf("%s, %s",
val_to_str (((param & 0xFF000000) >> 24), fc_lctl_pbsy_acode_val, "0x%x"),
val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_pbsy_rjt_val, "0x%x"));
}
- else if ((linkctl_type == FC_LCTL_FRJT) ||
+ if ((linkctl_type == FC_LCTL_FRJT) ||
(linkctl_type == FC_LCTL_PRJT)) {
- g_snprintf(errstr, MAX_ERRSTR_LEN, "%s, %s",
+ return g_strdup_printf("%s, %s",
val_to_str (((param & 0xFF000000) >> 24), fc_lctl_rjt_acode_val, "0x%x"),
val_to_str (((param & 0x00FF0000) >> 16), fc_lctl_rjt_val, "%x"));
}
-
- return (errstr);
+ return "";
}