diff options
author | Dario Lombardo <lomato@gmail.com> | 2016-10-25 11:52:28 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-26 21:45:03 +0000 |
commit | 8d0af2f57826b309404c5b7f3b02aaf5b3171f27 (patch) | |
tree | 40c0fa2aae111de1484854a48c8bf337d35be854 /ui/gtk/expert_comp_table.c | |
parent | dab4ea552dbeccbb403b6aff701a9de3bc25a64a (diff) | |
download | wireshark-8d0af2f57826b309404c5b7f3b02aaf5b3171f27.tar.gz |
Gtk: remove atoi calls and use ws_strtoi functions.
Change-Id: Ie38bdd27d9e3810e3a64b985dfd5621a3aa6d073
Reviewed-on: https://code.wireshark.org/review/18445
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/gtk/expert_comp_table.c')
-rw-r--r-- | ui/gtk/expert_comp_table.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/gtk/expert_comp_table.c b/ui/gtk/expert_comp_table.c index c215fc05a2..53bd0c3dac 100644 --- a/ui/gtk/expert_comp_table.c +++ b/ui/gtk/expert_comp_table.c @@ -37,6 +37,7 @@ #include "ui/simple_dialog.h" #include <wsutil/utf8_entities.h> +#include <wsutil/strtoi.h> #include "ui/gtk/expert_comp_table.h" #include "ui/gtk/filter_utils.h" @@ -115,9 +116,10 @@ proto_sort_func(GtkTreeModel *model, } else { if (grp == packet) { - gint int_a = atoi(str_a); - gint int_b = atoi(str_b); - if (int_a == int_b) + gint int_a = 0; + gint int_b = 0; + if (!ws_strtoi32(str_a, NULL, &int_a) || !ws_strtoi32(str_b, NULL, &int_b) || + int_a == int_b) ret = 0; else if (int_a < int_b) ret = -1; @@ -577,6 +579,7 @@ expert_goto_pkt_cb (GtkTreeSelection *selection, gpointer data _U_) GtkTreeIter iter; GtkTreeModel *model; gchar *pkt; + gint32 pkt_num = 0; gchar *grp; if (gtk_tree_selection_get_selected (selection, &model, &iter)) @@ -589,7 +592,8 @@ expert_goto_pkt_cb (GtkTreeSelection *selection, gpointer data _U_) -1); if (strcmp(grp, packet)==0) { - cf_goto_frame(&cfile, atoi(pkt)); + if (ws_strtoi32(pkt, NULL, &pkt_num)) + cf_goto_frame(&cfile, pkt_num); } g_free (pkt); } |