diff options
author | Gerald Combs <gerald@wireshark.org> | 2020-05-20 10:34:32 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2020-05-21 15:33:05 +0000 |
commit | 36ca304359c39be015a245bfc0d1ad1b1c05dbeb (patch) | |
tree | cb310dfc1296be3309a6827a40806f54c671a090 /dumpcap.c | |
parent | 2b9796adc6b1669da2bc4bb69f340131cc23eae9 (diff) |
dumpcap: Initialize a couple of variables.
Initialize err in capture_loop_init_output, as caught by both clang's
scan-build and Visual Studio's code analysis. Initialze err in
capture_loop_init_pcapng_output to match.
Move another variable to the code block in which it is used.
Change-Id: I0306ae6a02a02a8e1ebda89b7c574a7cae01b68f
Reviewed-on: https://code.wireshark.org/review/37274
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2895,7 +2895,7 @@ capture_loop_init_pcapng_output(capture_options *capture_opts, loop_data *ld) } gboolean successful = TRUE; - int err; + int err = 0; GString *os_info_str = g_string_new(""); get_os_version_info(os_info_str); @@ -2995,8 +2995,7 @@ capture_loop_init_pcapng_output(capture_options *capture_opts, loop_data *ld) static gboolean capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *errmsg, int errmsg_len) { - int err; - gboolean successful; + int err = 0; g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "capture_loop_init_output"); @@ -3032,6 +3031,7 @@ capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *err } } if (ld->pdh) { + gboolean successful; if (capture_opts->use_pcapng) { successful = capture_loop_init_pcapng_output(capture_opts, ld); } else { |