summaryrefslogtreecommitdiff
path: root/epan/column.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/column.c')
-rw-r--r--epan/column.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/epan/column.c b/epan/column.c
index 1bca3a40ae..8f132a309e 100644
--- a/epan/column.c
+++ b/epan/column.c
@@ -616,20 +616,22 @@ get_column_char_width(gint format)
}
gint
-get_column_format(gint col) {
+get_column_format(gint col)
+{
GList *clp = g_list_nth(prefs.col_list, col);
fmt_data *cfmt;
if (!clp) /* Invalid column requested */
return -1;
-
+
cfmt = (fmt_data *) clp->data;
return(get_column_format_from_str(cfmt->fmt));
}
gint
-get_column_format_from_str(gchar *str) {
+get_column_format_from_str(gchar *str)
+{
gint i;
for (i = 0; i < NUM_COL_FMTS; i++) {
@@ -640,20 +642,28 @@ get_column_format_from_str(gchar *str) {
}
gchar *
-get_column_title(gint col) {
+get_column_title(gint col)
+{
GList *clp = g_list_nth(prefs.col_list, col);
fmt_data *cfmt;
+ if (!clp) /* Invalid column requested */
+ return -1;
+
cfmt = (fmt_data *) clp->data;
return(cfmt->title);
}
const gchar *
-get_column_custom_field(gint col) {
+get_column_custom_field(gint col)
+{
GList *clp = g_list_nth(prefs.col_list, col);
fmt_data *cfmt;
+ if (!clp) /* Invalid column requested */
+ return -1;
+
cfmt = (fmt_data *) clp->data;
return(cfmt->custom_field);