diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-01-19 00:58:09 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-01-19 17:48:49 +0100 |
commit | 75b6425fe9ce8136dbc852415471708d365b4d25 (patch) | |
tree | 3d5533b150d5eb5fd3fe8efa8b667512a44edef7 /apps/pdfapp.c | |
parent | 08e84b18e5c1dbe8f3d32dd0aeb4b4c43debce9f (diff) | |
download | mupdf-75b6425fe9ce8136dbc852415471708d365b4d25.tar.xz |
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.
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r-- | apps/pdfapp.c | 4 |
1 files changed, 2 insertions, 2 deletions
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."); |