Commit 411823a3d0614d1268c84bd2add1b65b281ec824

Sergey Nikishin 2011-04-24T16:02:57

Fix whole buffer writing in fake wstream

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/odb.c b/src/odb.c
index 43d0ef9..b87f847 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -170,7 +170,7 @@ static int fake_wstream__write(git_odb_stream *_stream, const char *data, size_t
 {
 	fake_wstream *stream = (fake_wstream *)_stream;
 
-	if (stream->written + len >= stream->size)
+	if (stream->written + len > stream->size)
 		return GIT_ENOMEM;
 
 	memcpy(stream->buffer + stream->written, data, len);