From 3beab65515ab693806a7b64665bfd287133e860e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 20 Jul 2016 17:27:36 -0700 Subject: 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 --- ui/qt/capture_file_properties_dialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui/qt/capture_file_properties_dialog.cpp') diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp index 60ce9ddcb1..c4b835c6cf 100644 --- a/ui/qt/capture_file_properties_dialog.cpp +++ b/ui/qt/capture_file_properties_dialog.cpp @@ -248,7 +248,7 @@ QString CaptureFilePropertiesDialog::summaryToHtml() if (shb_inf != NULL) { QString capture_hardware(unknown); if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_HARDWARE, &str) == WTAP_OPTTYPE_SUCCESS) { - if (str != NULL && str[0] != '\0') { + if (str[0] != '\0') { capture_hardware = str; } } @@ -260,7 +260,7 @@ QString CaptureFilePropertiesDialog::summaryToHtml() QString capture_os(unknown); if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_OS, &str) == WTAP_OPTTYPE_SUCCESS) { - if (str != NULL && str[0] != '\0') { + if (str[0] != '\0') { capture_os = str; } } @@ -271,7 +271,7 @@ QString CaptureFilePropertiesDialog::summaryToHtml() QString capture_app(unknown); if (wtap_block_get_string_option_value(shb_inf, OPT_SHB_USERAPPL, &str) == WTAP_OPTTYPE_SUCCESS) { - if (str != NULL && str[0] != '\0') { + if (str[0] != '\0') { capture_app = str; } } -- cgit v1.2.1