diff options
author | João Valverde <j@v6e.pt> | 2021-10-01 14:26:43 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-10-01 16:04:37 +0000 |
commit | 04b0e2b80be9654bbe307c66943222fadf1f93c1 (patch) | |
tree | 09eec322aa66c159a99b2ce76ce4f6dcd86ce897 /epan/dfilter | |
parent | 90dc58a942fc608faa3debfbace832112d9d17b4 (diff) |
dfilter: Extend function 'tostr' method
Print function arguments instead of just a count.
Diffstat (limited to 'epan/dfilter')
-rw-r--r-- | epan/dfilter/sttype-function.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/epan/dfilter/sttype-function.c b/epan/dfilter/sttype-function.c index 4bc3825239..88abce9257 100644 --- a/epan/dfilter/sttype-function.c +++ b/epan/dfilter/sttype-function.c @@ -57,14 +57,26 @@ function_tostr(const void *data) { const function_t *stfuncrec = (const function_t *)data; const df_func_def_t *def = stfuncrec->funcdef; - guint args_len = 0; + GSList *params = stfuncrec->params; + GString *repr = g_string_new(""); + char *s; ws_assert(def); - if (stfuncrec->params != NULL) - args_len = g_slist_length(stfuncrec->params); + g_string_printf(repr, "%s(", def->name); + while (params != NULL) { + ws_assert(params->data); + s = stnode_tostr(params->data); + g_string_append(repr, s); + g_free(s); + params = params->next; + if (params != NULL) { + g_string_append(repr, ", "); + } + } + g_string_append_c(repr, ')'); - return g_strdup_printf("%s(n = %u)", def->name, args_len); + return g_string_free(repr, FALSE); } static void |