From: Nguyễn Thái Ngọc Duy Date: Sat, 24 Feb 2018 03:34:26 GMT Subject: [PATCH v2 2/5] sha1_file.c: keep a good name for "unknown" hash_algos[UNKNOWN] Message-ID: <20180224033429.9656-3-pclouds@gmail.com> In-Reply-To: <20180224033429.9656-1-pclouds@gmail.com> This is mostly for displaying the hash algorithm name when we report errors. Printing "unknown" with '%s' is much better than '(null)' in glibc printf version (and probably could crash if other implementations do not check for NULL pointer) Signed-off-by: Nguyễn Thái Ngọc Duy --- sha1_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha1_file.c b/sha1_file.c index 826d7a0ae3..4b266b1c68 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -71,7 +71,7 @@ static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx) const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = { { - NULL, + "unknown", 0x00000000, 0, 0, -- 2.16.1.435.g8f24da2e1a