[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgit
Subject:    [PATCH 3/4] ui-blob: remove useless null check
From:       John Keeping <john () keeping ! me ! uk>
Date:       2015-10-08 22:23:58
Message-ID: 1444343039-32055-4-git-send-email-john () keeping ! me ! uk
[Download RAW message or body]

We have already called strlen() on "path" by the time we get here, so we
know it can't be null.

Coverity-id: 13954
Signed-off-by: John Keeping <john@keeping.me.uk>
---
 ui-blob.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui-blob.c b/ui-blob.c
index b333f86..d3c3a10 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -85,7 +85,7 @@ int cgit_print_file(char *path, const char *head, int file_only)
 	if (get_sha1(head, sha1))
 		return -1;
 	type = sha1_object_info(sha1, &size);
-	if (type == OBJ_COMMIT && path) {
+	if (type == OBJ_COMMIT) {
 		commit = lookup_commit_reference(sha1);
 		read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
 		if (!walk_tree_ctx.found_path)
-- 
1.7.9.5

_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic