summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSverre Rabbelier <srabbelier@gmail.com>2010-03-28 05:42:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-28 16:26:16 (GMT)
commitbb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318 (patch)
tree5100e323dca019e8870cb3e86c20610e42aeebde
parent0476228de500049804ae599f557658c3f9042ad0 (diff)
downloadgit-bb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318.zip
git-bb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318.tar.gz
git-bb6ad28c23f05e1ea04e3f1c6b9b08cc070c5318.tar.bz2
fast-export: don't segfault when marks file cannot be opened
The error function only prints an error message, resulting in a segfault if we later on try to fprintf to a NULL handle. Fix this by using die_errno instead. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-fast-export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index b0a4029..c6dd71a 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -503,7 +503,7 @@ static void export_marks(char *file)
f = fopen(file, "w");
if (!f)
- error("Unable to open marks file %s for writing.", file);
+ die_errno("Unable to open marks file %s for writing.", file);
for (i = 0; i < idnums.size; i++) {
if (deco->base && deco->base->type == 1) {