From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 1/4] cgit.c: remove useless null check
Date: Thu, 8 Oct 2015 23:23:56 +0100 [thread overview]
Message-ID: <1444343039-32055-2-git-send-email-john@keeping.me.uk> (raw)
In-Reply-To: <1444343039-32055-1-git-send-email-john@keeping.me.uk>
Everywhere else in this function we do not check whether the value is
null and parse_configfile() never passes a null value to this callback.
Coverity-id: 13846
Signed-off-by: John Keeping <john at keeping.me.uk>
---
cgit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgit.c b/cgit.c
index 28a2f14..5937b9e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -110,7 +110,7 @@ static void config_cb(const char *name, const char *value)
ctx.repo->path = trim_end(value, '/');
else if (ctx.repo && starts_with(name, "repo."))
repo_config(ctx.repo, name + 5, value);
- else if (!strcmp(name, "readme") && value != NULL)
+ else if (!strcmp(name, "readme"))
string_list_append(&ctx.cfg.readme, xstrdup(value));
else if (!strcmp(name, "root-title"))
ctx.cfg.root_title = xstrdup(value);
--
1.7.9.5
next prev parent reply other threads:[~2015-10-08 22:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 22:23 [PATCH 0/4] Initial Coverity fixes john
2015-10-08 22:23 ` john [this message]
2015-10-08 22:23 ` [PATCH 2/4] scan-tree: remove useless strdup() john
2015-10-08 22:23 ` [PATCH 3/4] ui-blob: remove useless null check john
2015-10-08 22:23 ` [PATCH 4/4] ui-refs: " john
2015-10-09 8:54 ` [PATCH 0/4] Initial Coverity fixes Jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444343039-32055-2-git-send-email-john@keeping.me.uk \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).