summaryrefslogtreecommitdiff
path: root/source/tools/pdfpages.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-10-17 16:41:59 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-11-01 13:08:56 +0100
commit1dc763159b03cbd4387713f353f26c890d2c0e52 (patch)
treed43c18deeacd70e23d7e353c8f0c074c87419a34 /source/tools/pdfpages.c
parentf595e889b91a674eb94db7ca4d832da54f5194cd (diff)
downloadmupdf-1dc763159b03cbd4387713f353f26c890d2c0e52.tar.xz
Add separate fz_close_output step.
Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions.
Diffstat (limited to 'source/tools/pdfpages.c')
-rw-r--r--source/tools/pdfpages.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/source/tools/pdfpages.c b/source/tools/pdfpages.c
index 9e8f6050..70f601cd 100644
--- a/source/tools/pdfpages.c
+++ b/source/tools/pdfpages.c
@@ -175,7 +175,6 @@ int pdfpages_main(int argc, char **argv)
char *filename = "";
char *password = "";
int c;
- fz_output *out = NULL;
int ret;
fz_context *ctx;
@@ -200,19 +199,11 @@ int pdfpages_main(int argc, char **argv)
exit(1);
}
- fz_var(out);
-
ret = 0;
fz_try(ctx)
- {
- out = fz_stdout(ctx);
- ret = pdfpages_pages(ctx, out, filename, password, &argv[fz_optind], argc-fz_optind);
- }
+ ret = pdfpages_pages(ctx, fz_stdout(ctx), filename, password, &argv[fz_optind], argc-fz_optind);
fz_catch(ctx)
- {
ret = 1;
- }
- fz_drop_output(ctx, out);
fz_drop_context(ctx);
return ret;
}