diff options
author | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-27 16:55:24 +0000 |
---|---|---|
committer | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-27 16:55:24 +0000 |
commit | 79fd23e8c7c5cf34fc97237be434278dba58aa15 (patch) | |
tree | 10e8a934441d70617b5b64fd760887800706176f /tap-stats_tree.c | |
parent | 68e1040a4b2a74e3d9cf2467905db69997eca6b9 (diff) |
Several fixes to the stats_tree
- Avoid creating a copy of every branch at reinitialization
this used to cause some GTK warnings and a leakage of tree nodes
- propperly check the optarg to avoid getting junk in the filter text
this caused a crash
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13534 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap-stats_tree.c')
-rw-r--r-- | tap-stats_tree.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tap-stats_tree.c b/tap-stats_tree.c index a09bf637b1..2c85abcd92 100644 --- a/tap-stats_tree.c +++ b/tap-stats_tree.c @@ -45,15 +45,17 @@ struct _tree_pres { static void draw_stats_tree(void *psp) { stats_tree *st = psp; GString* s; + gchar* fmt; stat_node* child; s = g_string_new("\n===================================================================\n"); - - g_string_sprintfa(s,"Statistics for %s\n===================================================================\n", - st->name); + fmt = g_strdup_printf(" %%s%%-%us%%12s\t%%12s\t%%12s\n",stats_branch_max_name_len(&st->root,0)); + g_string_sprintfa(s,fmt,"",st->name,"value","rate","percent"); + g_free(fmt); + g_string_sprintfa(s,"-------------------------------------------------------------------\n"); for (child = st->root.children; child; child = child->next ) { - stat_branch_to_str(child,s,1); + stat_branch_to_str(child,s,0); } s = g_string_append(s,"\n===================================================================\n"); |