Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Avoid errors and warnings when attempting to do I/O on zero bytes
[gitweb.git]
/
sha1_file.c
diff --git
a/sha1_file.c
b/sha1_file.c
index 53e25f278c6193860431f63a3c9de97f4e347f27..18dd89b50a23a4a99b51d8e99d0c67cace2a1a2d 100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1620,6
+1620,8
@@
static int write_buffer(int fd, const void *buf, size_t len)
{
ssize_t size;
+ if (!len)
+ return 0;
size = write_in_full(fd, buf, len);
if (!size)
return error("file write: disk full");