summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 0e19cbaacc..f1e7a4d5d9 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -718,9 +718,9 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
result = xmalloc(len + 1);
while (sz < len) {
ssize_t done = xread(fd, result+sz, len-sz);
- if (done == 0)
- break;
- if (done < 0)
+ if (done == 0 && sz != len)
+ die("early EOF '%s'", elem->path);
+ else if (done < 0)
die("read error '%s'", elem->path);
sz += done;
}