X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=test-delta.c;h=89eb68ed21545e4001c08dd21b5e907e22b979bb;hb=061ad5f4de16b4997f1de962dc4512546c62fe53;hp=37ef86b283c2378017f1fc6bff05cc33fb25d7aa;hpb=07ee0d77c66d6f356cd3f82435e67510779aa53c;p=git.git diff --git a/test-delta.c b/test-delta.c index 37ef86b2..89eb68ed 100644 --- a/test-delta.c +++ b/test-delta.c @@ -17,7 +17,7 @@ #include #include "delta.h" -static const char *usage = +static const char usage[] = "test-delta (-d|-p) "; int main(int argc, char *argv[]) @@ -41,6 +41,7 @@ int main(int argc, char *argv[]) from_buf = mmap(NULL, from_size, PROT_READ, MAP_PRIVATE, fd, 0); if (from_buf == MAP_FAILED) { perror(argv[2]); + close(fd); return 1; } close(fd); @@ -54,6 +55,7 @@ int main(int argc, char *argv[]) data_buf = mmap(NULL, data_size, PROT_READ, MAP_PRIVATE, fd, 0); if (data_buf == MAP_FAILED) { perror(argv[3]); + close(fd); return 1; } close(fd); @@ -61,7 +63,7 @@ int main(int argc, char *argv[]) if (argv[1][1] == 'd') out_buf = diff_delta(from_buf, from_size, data_buf, data_size, - &out_size, 0); + &out_size, 0, NULL); else out_buf = patch_delta(from_buf, from_size, data_buf, data_size,