diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-30 21:00:21 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-30 21:00:21 +0000 |
commit | ac9b982868be71dec3cc9a451563af64fabf675a (patch) | |
tree | f4e5a5f9ea33406eb0e4c7d7004bd5b198c42793 /epan/stats_tree.c | |
parent | fd2f05446d0b1003e1aef42a1c7b2767b8dc9ea4 (diff) |
Better fix for uninitialized variable warning. Part of bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Peter Wu.
From me: Leave the "result" variable initialized because I'm not sure code analyzers will consider g_assert_not_reached() enough prevention from using uninitialized "result"
svn path=/trunk/; revision=53679
Diffstat (limited to 'epan/stats_tree.c')
-rw-r--r-- | epan/stats_tree.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/stats_tree.c b/epan/stats_tree.c index e1fafe79f5..39928ff5f2 100644 --- a/epan/stats_tree.c +++ b/epan/stats_tree.c @@ -1163,7 +1163,7 @@ stats_tree_sort_compare (const stat_node *a, const stat_node *b, gint sort_colum result = a->rng->floor - b->rng->floor; if (sort_descending&&(!prefs.st_sort_rng_fixorder)) { result= -result; - } + } return result; } @@ -1203,8 +1203,13 @@ stats_tree_sort_compare (const stat_node *a, const stat_node *b, gint sort_colum break; case COL_BURSTRATE: result = a->max_burst - b->max_burst; + break; + + default: + /* see stats_tree_is_sortable_column */ + g_assert_not_reached(); } - + /* break tie between items with same primary search result */ if (!result) { if (sort_column==COL_NAME) { |