summaryrefslogtreecommitdiff
path: root/capinfos.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-07-20 11:09:06 -0400
committerAnders Broman <a.broman58@gmail.com>2015-08-18 05:52:45 +0000
commite25562baddd7a675510daea9bb6a6e4ab36b2d68 (patch)
tree2338173d5f211716b8004c915ee92713d197c1b1 /capinfos.c
parent4048ca0a27b7ed693b91103ed6912a4a1abfa3db (diff)
downloadwireshark-e25562baddd7a675510daea9bb6a6e4ab36b2d68.tar.gz
Pcapng: clean up Section Header Block handling
Change-Id: I8516d0c561ed0b63e49a3594027c9c15bb789258 Reviewed-on: https://code.wireshark.org/review/9726 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/capinfos.c b/capinfos.c
index 3ca451c0cf..dd20593c5e 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -1012,7 +1012,7 @@ process_cap_file(wtap *wth, const char *filename)
nstime_t prev_time;
gboolean know_order = FALSE;
order_t order = IN_ORDER;
- wtapng_section_t *shb_inf;
+ const gchar *shb_comment;
gchar *p;
@@ -1167,19 +1167,18 @@ process_cap_file(wtap *wth, const char *filename)
}
cf_info.comment = NULL;
- shb_inf = wtap_file_get_shb_info(wth);
- if (shb_inf) {
+ shb_comment = wtap_file_get_shb_comment(wth);
+ if (shb_comment) {
/* opt_comment is always 0-terminated by pcapng_read_section_header_block */
- cf_info.comment = g_strdup(shb_inf->opt_comment);
- }
- g_free(shb_inf);
- if (cf_info.comment) {
+ cf_info.comment = g_strdup(shb_comment);
/* multi-line comments would conflict with the formatting that capinfos uses
- we replace linefeeds with spaces */
+ we replace carriage-returns/linefeeds with spaces */
p = cf_info.comment;
while (*p != '\0') {
if (*p == '\n')
*p = ' ';
+ if (*p == '\r')
+ *p = ' ';
p++;
}
}