From 1dc763159b03cbd4387713f353f26c890d2c0e52 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 17 Oct 2017 16:41:59 +0200 Subject: Add separate fz_close_output step. Closing flushes output and may throw exceptions. Dropping frees the state and never throws exceptions. --- source/tools/pdfpages.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source/tools/pdfpages.c') 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; } -- cgit v1.2.3