summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/oid.c b/src/oid.c
index 1bf74b963..bbdd8541b 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -95,12 +95,12 @@ char *git_oid_tostr(char *out, size_t n, const git_oid *oid)
{
char str[GIT_OID_HEXSZ];
- if (!out || n == 0 || !oid)
+ if (!out || n == 0)
return "";
n--; /* allow room for terminating NUL */
- if (n > 0) {
+ if (n > 0 && oid != NULL) {
git_oid_fmt(str, oid);
if (n > GIT_OID_HEXSZ)
n = GIT_OID_HEXSZ;