From 81d65ccec65c9bbe972fcb64933fc34d9679562c Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 19 May 2016 22:28:43 -0400 Subject: Add wtap_optionblock_set_option_string_format Also add a length parameter to wtap_optionblock_set_option_string Change-Id: I8c7bbc48aa96b5c2a91ab9a17980928d6894f1ee Reviewed-on: https://code.wireshark.org/review/15505 Reviewed-by: Anthony Coddington Reviewed-by: Michael Mann --- wiretap/wtap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'wiretap/wtap.c') diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 30f4123fe0..bdc74adcbf 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -191,7 +191,7 @@ wtap_file_get_shb_for_new_file(wtap *wth) /* options */ wtap_optionblock_get_option_string(wth->shb_hdr, OPT_COMMENT, &opt_comment); - wtap_optionblock_set_option_string(shb_hdr, OPT_COMMENT, opt_comment); + wtap_optionblock_set_option_string(shb_hdr, OPT_COMMENT, opt_comment, (gsize)(opt_comment ? strlen(opt_comment) : 0)); return shb_hdr; } @@ -221,13 +221,13 @@ wtap_write_nrb_comment(wtap *wth, gchar *comment) wth->nrb_hdr = wtap_optionblock_create(WTAP_OPTION_BLOCK_NG_NRB); } - wtap_optionblock_set_option_string(wth->nrb_hdr, OPT_COMMENT, comment); + wtap_optionblock_set_option_string(wth->nrb_hdr, OPT_COMMENT, comment, (gsize)(comment ? strlen(comment) : 0)); } void wtap_write_shb_comment(wtap *wth, gchar *comment) { - wtap_optionblock_set_option_string(wth->shb_hdr, OPT_COMMENT, comment); + wtap_optionblock_set_option_string(wth->shb_hdr, OPT_COMMENT, comment, (gsize)(comment ? strlen(comment) : 0)); } wtapng_iface_descriptions_t * -- cgit v1.2.3