From 526182d28c42bba3ae6b16940438d800f99285d5 Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Tue, 20 Jan 2015 23:24:32 +0200 Subject: [PATCH 1/2] Remove logically dead code (we're already asserting) --- src/repository.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repository.c b/src/repository.c index 0cf8eb66b..f49a25124 100644 --- a/src/repository.c +++ b/src/repository.c @@ -1836,7 +1836,7 @@ int git_repository_hashfile( */ error = git_path_join_unrooted( - &full_path, path, repo ? git_repository_workdir(repo) : NULL, NULL); + &full_path, path, git_repository_workdir(repo), NULL); if (error < 0) return error; From 9ae4ad2dafd918b95dc976bed97604a985a2b4dd Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Tue, 20 Jan 2015 23:26:55 +0200 Subject: [PATCH 2/2] Treat a NULL string as if it's empty --- src/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pool.c b/src/pool.c index a5dfa0f49..7350c04c1 100644 --- a/src/pool.c +++ b/src/pool.c @@ -225,7 +225,7 @@ char *git_pool_strcat(git_pool *pool, const char *a, const char *b) void *ptr; size_t len_a, len_b; - assert(pool && a && b && pool->item_size == sizeof(char)); + assert(pool && pool->item_size == sizeof(char)); len_a = a ? strlen(a) : 0; len_b = b ? strlen(b) : 0;