mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 21:08:56 +00:00
Fix oid tostr issue with NULL oid
I made a small change to the behavior of this code and apparently got it wrong. Sigh.
This commit is contained in:
parent
d8889d2b64
commit
1b88faf7ae
@ -100,7 +100,10 @@ char *git_oid_tostr(char *out, size_t n, const git_oid *oid)
|
|||||||
|
|
||||||
n--; /* allow room for terminating NUL */
|
n--; /* allow room for terminating NUL */
|
||||||
|
|
||||||
if (n > 0 && oid != NULL) {
|
if (oid == NULL)
|
||||||
|
n = 0;
|
||||||
|
|
||||||
|
if (n > 0) {
|
||||||
git_oid_fmt(str, oid);
|
git_oid_fmt(str, oid);
|
||||||
if (n > GIT_OID_HEXSZ)
|
if (n > GIT_OID_HEXSZ)
|
||||||
n = GIT_OID_HEXSZ;
|
n = GIT_OID_HEXSZ;
|
||||||
|
Loading…
Reference in New Issue
Block a user