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 --- file.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 73eef29fe8..f1773697be 100644 --- a/file.c +++ b/file.c @@ -3866,11 +3866,9 @@ cf_update_capture_comment(capture_file *cf, gchar *comment) wtap_block_add_string_option(shb_inf, OPT_COMMENT, comment, strlen(comment)); } else { /* See if the comment has changed or not */ - if (shb_comment) { - if (strcmp(shb_comment, comment) == 0) { - g_free(comment); - return; - } + if (strcmp(shb_comment, comment) == 0) { + g_free(comment); + return; } /* The comment has changed, let's update it */ -- cgit v1.2.1