diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-09-09 02:11:53 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-09-09 02:11:53 +0000 |
commit | f4c675f712395a3e793ef5ff29dfbedab5d46c52 (patch) | |
tree | 87a68609cc8623274c72a49cf0651c1aebecaaf6 /gtk/conversations_table.c | |
parent | 3ed0fa717ee0cc9299ae7af3e7c70fc5fe4114ce (diff) |
Fix locale problem with "Rel Start" time, both with display and copy to CSV, by replacing rel_time_to_secs_str() with nstime_to_sec(). Problem reported on ask by packethunter.
Ref: http://ask.wireshark.org/questions/6207/decimal-point-vs-decimal-comma
svn path=/trunk/; revision=38948
Diffstat (limited to 'gtk/conversations_table.c')
-rw-r--r-- | gtk/conversations_table.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/conversations_table.c b/gtk/conversations_table.c index c84d027ec5..4dbb5fa39a 100644 --- a/gtk/conversations_table.c +++ b/gtk/conversations_table.c @@ -2083,7 +2083,7 @@ draw_ct_table_data(conversations_table *ct) first = FALSE; } duration_s = nstime_to_sec(&conversation->stop_time) - nstime_to_sec(&conversation->start_time); - g_snprintf(start_time, COL_STR_LEN, "%s", rel_time_to_secs_str(&conversation->start_time)); + g_snprintf(start_time, COL_STR_LEN, "%.9f", nstime_to_sec(&conversation->start_time)); g_snprintf(duration, COL_STR_LEN, "%.4f", duration_s); if (duration_s > 0 && conversation->tx_frames > 1) { @@ -2208,7 +2208,7 @@ csv_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, g_string_append_printf(csv->CSV_str, "\"%" G_GINT64_MODIFIER "u\"", value); break; case START_COLUMN: - g_string_append_printf(csv->CSV_str, "\"%s\"", rel_time_to_secs_str(&conv->start_time)); + g_string_append_printf(csv->CSV_str, "\"%.9f\"", nstime_to_sec(&conv->start_time)); break; case DURATION_COLUMN: g_string_append_printf(csv->CSV_str, "\"%.4f\"", duration_s); @@ -2241,7 +2241,6 @@ static void copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) { GtkClipboard *cb; - char *savelocale; GList *columns, *list; GtkTreeViewColumn *column; GtkListStore *store; @@ -2251,8 +2250,6 @@ copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) if (!csv.talkers) return; - savelocale = setlocale(LC_NUMERIC, NULL); - setlocale(LC_NUMERIC, "C"); csv.CSV_str = g_string_new(""); columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(csv.talkers->table)); @@ -2278,7 +2275,6 @@ copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) /* Now that we have the CSV data, copy it into the default clipboard */ cb = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); /* Get the default clipboard */ gtk_clipboard_set_text(cb, csv.CSV_str->str, -1); /* Copy the CSV data into the clipboard */ - setlocale(LC_NUMERIC, savelocale); g_string_free(csv.CSV_str, TRUE); /* Free the memory */ } |