diff options
-rw-r--r-- | builtin-mailinfo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index d498b1cd2..c90cd312a 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -785,8 +785,10 @@ static int handle_commit_msg(struct strbuf *line) if (use_scissors && is_scissors_line(line)) { int i; - rewind(cmitmsg); - ftruncate(fileno(cmitmsg), 0); + if (fseek(cmitmsg, 0L, SEEK_SET)) + die_errno("Could not rewind output message file"); + if (ftruncate(fileno(cmitmsg), 0)) + die_errno("Could not truncate output message file at scissors"); still_looking = 1; /* |