author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 22 Dec 2005 17:55:59 +0000 (18:55 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Dec 2005 20:52:37 +0000 (12:52 -0800) | ||
commit | 1e80e0449248edb77b0fb9853f4a3404a599e207 | |
tree | 6796de66f2dfb8ba71ae50ac4c5cc2e1c58438ea | tree | snapshot |
parent | a14c225661fa2fc271d9e0fbf262e369dc7254fc | commit | diff |
sha1_to_hex: properly terminate the SHA1
sha1_to_hex() returns a pointer to a static buffer. Some of its users
modify that buffer by appending a newline character. Other users rely
on the fact that you can call
printf("%s", sha1_to_hex(sha1));
Just to be on the safe side, terminate the SHA1 in sha1_to_hex().
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_to_hex() returns a pointer to a static buffer. Some of its users
modify that buffer by appending a newline character. Other users rely
on the fact that you can call
printf("%s", sha1_to_hex(sha1));
Just to be on the safe side, terminate the SHA1 in sha1_to_hex().
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c | diff | blob | history |