summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-09-28 11:57:02 -0700
committerVicent Martí <vicent@github.com>2012-09-28 11:57:02 -0700
commit34402bcdb94ff412e66220ada0b776c25cd8c30d (patch)
tree293c426c922de1e12e4da6a5d39a4fcf3d3843f2 /src
parent3f849902e4b20216c80ec69714d6a6a0fdd332d2 (diff)
parentaddc9be4fcb88e77107557e991bd92355522d844 (diff)
downloadlibgit2-34402bcdb94ff412e66220ada0b776c25cd8c30d.tar.gz
Merge pull request #959 from jamill/empty_file_hash
Fix error hashing empty file.
Diffstat (limited to 'src')
-rw-r--r--src/odb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/odb.c b/src/odb.c
index d1ffff652..d951bc51b 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -115,7 +115,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
int hdr_len;
char hdr[64], buffer[2048];
git_hash_ctx *ctx;
- ssize_t read_len = -1;
+ ssize_t read_len = 0;
if (!git_object_typeisloose(type)) {
giterr_set(GITERR_INVALID, "Invalid object type for hash");