Commit 454a6b592b0a6aa8a7bf176c74a517c545d26521

Stefan Sperling 2018-12-24T17:32:40

fix fwrite() call in got_object_blob_dump_to_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object.c b/lib/object.c
index ddf52c6..5db2105 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -1137,7 +1137,7 @@ got_object_blob_dump_to_file(size_t *total_len, int *nlines,
 			}
 		}
 		/* Skip blob object header first time around. */
-		n = fwrite(buf + hdrlen, len - hdrlen, 1, outfile);
+		n = fwrite(buf + hdrlen, 1, len - hdrlen, outfile);
 		if (n != len - hdrlen)
 			return got_ferror(outfile, GOT_ERR_IO);
 		hdrlen = 0;