aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-07-20 17:27:36 -0700
committerGuy Harris <guy@alum.mit.edu>2016-07-21 00:28:18 +0000
commit3beab65515ab693806a7b64665bfd287133e860e (patch)
tree8c6aa291589c54f2f2f96a7dca4bcb5c4518fcdd /tshark.c
parentbe1398c17ca1d5b203a930d9254125d602830aef (diff)
No need to check for string option values being null.
A string option, if present, always has a value; it might be a null *string*, but you won't get a null pointer (if the option isn't present, it simply isn't present). Fix some comments while we're at it. Change-Id: I9c1420f56998a7d04de5c5cc2e92631b181f303a Reviewed-on: https://code.wireshark.org/review/16564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tshark.c b/tshark.c
index 8fac691195..452e420bb3 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2877,8 +2877,7 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
nrb_hdrs = wtap_file_get_nrb_for_new_file(cf->wth);
/* If we don't have an application name add Tshark */
- if (wtap_block_get_string_option_value(g_array_index(shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, &shb_user_appl) != WTAP_OPTTYPE_SUCCESS ||
- shb_user_appl == NULL) {
+ if (wtap_block_get_string_option_value(g_array_index(shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, &shb_user_appl) != WTAP_OPTTYPE_SUCCESS) {
/* this is free'd by wtap_block_free() later */
wtap_block_add_string_option_format(g_array_index(shb_hdrs, wtap_block_t, 0), OPT_SHB_USERAPPL, "TShark (Wireshark) %s", get_ws_vcs_version_info());
}