aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/hostlist_table.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-02-16 23:10:00 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-02-16 23:10:00 +0000
commitd44874db22aa5c6a2191c7e2e7c1657723489cb2 (patch)
tree571340d800558f0ad6ab422d5e15088e6cf1194b /gtk/hostlist_table.c
parentc7cd19345ca6490f0e251306bdeea4d1436f0168 (diff)
Don't try to fetch columns that don't exist.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31902 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/hostlist_table.c')
-rw-r--r--gtk/hostlist_table.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/gtk/hostlist_table.c b/gtk/hostlist_table.c
index 792ee7d8d4..e4fa9cc1fc 100644
--- a/gtk/hostlist_table.c
+++ b/gtk/hostlist_table.c
@@ -767,42 +767,48 @@ map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
return FALSE;
}
- /* latitude */
+ /* Latitude */
gtk_tree_model_get(model, iter, map->col_lat, &table_entry, -1);
fputs(table_entry, map->out_file);
g_free(table_entry);
fputs("\t", map->out_file);
- /* longitude */
+ /* Longitude */
gtk_tree_model_get(model, iter, map->col_lon, &table_entry, -1);
fputs(table_entry, map->out_file);
g_free(table_entry);
fputs("\t", map->out_file);
- /* title */
+ /* Title */
gtk_tree_model_get(model, iter, map->col_ip, &table_entry, -1);
fputs(table_entry, map->out_file);
g_free(table_entry);
fputs("\t", map->out_file);
- /* description */
- gtk_tree_model_get(model, iter, map->col_as_num, &table_entry, -1);
- fputs("AS: ", map->out_file);
- fputs(table_entry, map->out_file);
- g_free(table_entry);
- fputs("<br/>", map->out_file);
+ /* Description */
+ if (map->col_as_num >= 0) {
+ gtk_tree_model_get(model, iter, map->col_as_num, &table_entry, -1);
+ fputs("AS: ", map->out_file);
+ fputs(table_entry, map->out_file);
+ g_free(table_entry);
+ fputs("<br/>", map->out_file);
+ }
- gtk_tree_model_get(model, iter, map->col_country, &table_entry, -1);
- fputs("Country: ", map->out_file);
- fputs(table_entry, map->out_file);
- g_free(table_entry);
- fputs("<br/>", map->out_file);
+ if (map->col_country >= 0) {
+ gtk_tree_model_get(model, iter, map->col_country, &table_entry, -1);
+ fputs("Country: ", map->out_file);
+ fputs(table_entry, map->out_file);
+ g_free(table_entry);
+ fputs("<br/>", map->out_file);
+ }
- gtk_tree_model_get(model, iter, map->col_city, &table_entry, -1);
- fputs("City: ", map->out_file);
- fputs(table_entry, map->out_file);
- g_free(table_entry);
- fputs("<br/>", map->out_file);
+ if (map->col_country >= 0) {
+ gtk_tree_model_get(model, iter, map->col_city, &table_entry, -1);
+ fputs("City: ", map->out_file);
+ fputs(table_entry, map->out_file);
+ g_free(table_entry);
+ fputs("<br/>", map->out_file);
+ }
gtk_tree_model_get(model, iter, map->col_packets, &value, -1);
fprintf(map->out_file, "Packets: %" G_GINT64_MODIFIER "u<br/>", value);