diff options
author | Michael Mann <mmann78@netscape.net> | 2016-01-13 23:37:53 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-01-14 18:44:55 +0000 |
commit | baf3321942459b54863736bdbe61a9335d550601 (patch) | |
tree | 35dfb410299d6cab94c2e6f9abe4308d70709558 /editcap.c | |
parent | a50c230f98dacad9f66535127fa734eaeab08469 (diff) |
[editcap] Bugfix tree compare function.
Bug: 12007
Change-Id: Icd31988ebbfe1e0bf4d29f32462c58c6c2c55547
Reviewed-on: https://code.wireshark.org/review/13277
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -841,14 +841,17 @@ list_encap_types(void) { g_free(encaps); } -/* TODO: is there the equivalent of g_direct_equal? */ static int -framenum_equal(gconstpointer a, gconstpointer b, gpointer user_data _U_) +framenum_compare(gconstpointer a, gconstpointer b, gpointer user_data _U_) { - return (a != b); -} + if (GPOINTER_TO_UINT(a) < GPOINTER_TO_UINT(b)) + return -1; + if (GPOINTER_TO_UINT(a) > GPOINTER_TO_UINT(b)) + return 1; + return 0; +} #ifdef HAVE_PLUGINS /* @@ -1019,7 +1022,7 @@ main(int argc, char *argv[]) /* Lazily create the table */ if (!frames_user_comments) { - frames_user_comments = g_tree_new_full(framenum_equal, NULL, NULL, g_free); + frames_user_comments = g_tree_new_full(framenum_compare, NULL, NULL, g_free); } /* Insert this entry (framenum -> comment) */ |