summaryrefslogtreecommitdiff
path: root/capinfos.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 /capinfos.c
parentbe1398c17ca1d5b203a930d9254125d602830aef (diff)
downloadwireshark-3beab65515ab693806a7b64665bfd287133e860e.tar.gz
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 'capinfos.c')
-rw-r--r--capinfos.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/capinfos.c b/capinfos.c
index f4ea0bb63a..4b8debab94 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -993,34 +993,29 @@ print_stats_table(const gchar *filename, capture_info *cf_info)
char *opt_comment;
for (i = 0; wtap_block_get_nth_string_option_value(cf_info->shb, OPT_COMMENT, i, &opt_comment) == WTAP_OPTTYPE_SUCCESS; i++) {
- if (opt_comment != NULL) {
- putsep();
- putquote();
- printf("%s", opt_comment);
- putquote();
- }
+ putsep();
+ putquote();
+ printf("%s", opt_comment);
+ putquote();
}
}
if (cap_file_more_info) {
char *str;
- if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_HARDWARE, &str) == WTAP_OPTTYPE_SUCCESS &&
- str != NULL) {
+ if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_HARDWARE, &str) == WTAP_OPTTYPE_SUCCESS) {
putsep();
putquote();
printf("%s", str);
putquote();
}
- if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_OS, &str) == WTAP_OPTTYPE_SUCCESS &&
- str != NULL) {
+ if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_OS, &str) == WTAP_OPTTYPE_SUCCESS) {
putsep();
putquote();
printf("%s", str);
putquote();
}
- if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_USERAPPL, &str) == WTAP_OPTTYPE_SUCCESS &&
- str != NULL) {
+ if (wtap_block_get_string_option_value(cf_info->shb, OPT_SHB_USERAPPL, &str) == WTAP_OPTTYPE_SUCCESS) {
putsep();
putquote();
printf("%s", str);