nstime_t del_cap_ts; /* Delta timestamp to previous captured frame (yes, it can be negative) */
gint64 file_off; /* File offset */
gchar **col_text; /* The column text for some columns, see colum_utils */
+ guint *col_text_len; /* The length of the column text strings in 'col_text' */
} frame_data;
/*
fdata->flags.ref_time = 0;
fdata->color_filter = NULL;
fdata->col_text = NULL;
+ fdata->col_text_len = NULL;
fdata->abs_ts.secs = phdr->ts.secs;
fdata->abs_ts.nsecs = phdr->ts.nsecs;
g_assert(record->physical_pos == row);
if (record->fdata->col_text && record->fdata->col_text[col] != NULL)
- /* Column already contains a value. Bail out */
+ /* TODO: Column already contains a value. Bail out */
return;
- if (!record->fdata->col_text)
+ if (!record->fdata->col_text) {
+ record->fdata->col_text_len = se_alloc0(sizeof(record->fdata->col_text) *
+ (packet_list->n_columns-1));
record->fdata->col_text = se_alloc0(sizeof(record->fdata->col_text) *
(packet_list->n_columns-1));
+ }
switch (cfile.cinfo.col_fmt[col]) {
case COL_PROTOCOL:
if (cinfo->col_data[col] != cinfo->col_buf[col]) {
/* This is a constant string, so we don't have to copy it */
record->fdata->col_text[col] = (gchar *) cinfo->col_data[col];
+ record->fdata->col_text_len[col] = (guint) strlen(record->fdata->col_text[col]);
break;
}
/* !! FALL-THROUGH!! */
default:
- record->fdata->col_text[col] = se_strdup(cinfo->col_data[col]);
+ record->fdata->col_text_len[col] = (guint) strlen(cinfo->col_data[col]);
+ record->fdata->col_text[col] = se_memdup(cinfo->col_data[col],
+ record->fdata->col_text_len[col] + 1);
break;
}
}