From 75b6425fe9ce8136dbc852415471708d365b4d25 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 19 Jan 2012 00:58:09 +0100 Subject: Remove confusing optional 'password' argument to pdf_open_xref. Require that clients call pdf_needs_password/pdf_authenticate_password instead. For dumb clients, we still allow for decrypting a file with a blank password without calling those functions. --- apps/pdfapp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/pdfapp.c') diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 5b839eb1..3ad71c9a 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -113,7 +113,7 @@ static void pdfapp_open_pdf(pdfapp_t *app, char *filename, int fd) fz_try(ctx) { file = fz_open_fd(ctx, fd); - app->xref = pdf_open_xref_with_stream(file, NULL); + app->xref = pdf_open_xref_with_stream(file); fz_close(file); } fz_catch(ctx) @@ -132,7 +132,7 @@ static void pdfapp_open_pdf(pdfapp_t *app, char *filename, int fd) { password = winpassword(app, filename); if (!password) - exit(1); + pdfapp_error(app, "Needs a password."); okay = pdf_authenticate_password(app->xref, password); if (!okay) pdfapp_warn(app, "Invalid password."); -- cgit v1.2.3