diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-03 13:36:02 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-03 21:36:47 +0000 |
commit | dfa50e6bd839641d9d137dcc8771f191e62cc031 (patch) | |
tree | 5f450fd55e65f3a82cce96d8b922f4d8b6b7a00c /text2pcap.c | |
parent | a190c936d754f553e218de7174223b12c49b6b3e (diff) |
Use get_ws_vcs_version() to generate the version string.
That's what we do in, for example, dumpcap.
Also, use g_strdup_printf() for the strings, rather than using
fixed-length arrays.
Change-Id: I36ad201e3eda903ef3a089bafb09df0581efe512
Reviewed-on: https://code.wireshark.org/review/6284
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/text2pcap.c b/text2pcap.c index 326a1ca96d..951db9659c 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -142,7 +142,6 @@ #include "pcapio.h" #include "text2pcap.h" -#include "version.h" #ifdef _WIN32 #include <wsutil/unicode-utils.h> @@ -921,22 +920,21 @@ write_file_header (void) gboolean success; if (use_pcapng) { -#ifdef GITVERSION - const char *appname = "text2pcap (" GITVERSION " from " GITBRANCH ")"; -#else - const char *appname = "text2pcap"; -#endif - char comment[100]; + char *appname; + char *comment; - g_snprintf(comment, sizeof(comment), "Generated from input file %s.", input_filename); + appname = g_strdup_printf("text2pcap (Wireshark) %s", get_ws_vcs_version_info()); + comment = g_strdup_printf("Generated from input file %s.", input_filename); success = pcapng_write_session_header_block(output_file, comment, - NULL, - NULL, + NULL, /* HW */ + NULL, /* OS */ appname, - -1, + -1, /* section_length */ &bytes_written, &err); + g_free(appname); + g_free(comment); if (success) { success = pcapng_write_interface_description_block(output_file, NULL, |