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 --- tshark.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index c4ade31a2b..dc28f8769e 100644 --- a/tshark.c +++ b/tshark.c @@ -3272,9 +3272,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, wtap_optionblock_get_option_string(shb_hdr, OPT_SHB_USERAPPL, &shb_user_appl); if (shb_user_appl == NULL) { /* this is free'd by wtap_optionblock_free() later */ - shb_user_appl = g_strdup_printf("TShark (Wireshark) %s", get_ws_vcs_version_info()); - wtap_optionblock_set_option_string(shb_hdr, OPT_SHB_USERAPPL, shb_user_appl); - g_free(shb_user_appl); + wtap_optionblock_set_option_string_format(shb_hdr, OPT_SHB_USERAPPL, "TShark (Wireshark) %s", get_ws_vcs_version_info()); } if (linktype != WTAP_ENCAP_PER_PACKET && -- cgit v1.2.1