If we don't get any OS information, remove the old OS information.

The old information is copied over from one of the input files; if we
don't have information about the OS on the machine writing the *output*
file, just throw the old information away.

(We need a better way to preserve information from the input files;
perhaps this:

   http://www.winpcap.org/pipermail/pcap-ng-format/2016-June/000362.html

might work.)

Change-Id: Ia25771736d267173f2b6949a91e81e217ee7d16f
Reviewed-on: https://code.wireshark.org/review/16730
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-07-27 14:31:21 -07:00
parent e8f4fea259
commit 93d5df468f
1 changed files with 5 additions and 0 deletions

View File

@ -418,6 +418,11 @@ create_shb_header(const merge_in_file_t *in_files, const guint in_file_count,
wtap_block_set_string_option_value(shb_hdr, OPT_SHB_OS, opt_str, opt_len); /* UTF-8 string containing the name */
/* of the operating system used to create this section. */
g_free(opt_str);
} else {
/*
* No OS information; remove the old version.
*/
wtap_block_remove_option(shb_hdr, OPT_SHB_OS);
}
wtap_block_set_string_option_value(shb_hdr, OPT_SHB_USERAPPL, (char*)app_name, app_name ? strlen(app_name): 0 ); /* NULL if not available, UTF-8 string containing the name */
/* of the application used to create this section. */