summaryrefslogtreecommitdiff
path: root/apps/common/pdfapp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/common/pdfapp.c')
-rw-r--r--apps/common/pdfapp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/common/pdfapp.c b/apps/common/pdfapp.c
index 9174cbc1..9e0d4962 100644
--- a/apps/common/pdfapp.c
+++ b/apps/common/pdfapp.c
@@ -105,15 +105,14 @@ void pdfapp_open(pdfapp_t *app, char *filename)
if (app->xref->crypt)
{
- error = pdf_setpassword(app->xref->crypt, password);
- while (error)
+ int okay = pdf_setpassword(app->xref->crypt, password);
+ while (!okay)
{
- fz_droperror(error);
password = winpassword(app, filename);
if (!password)
exit(1);
- error = pdf_setpassword(app->xref->crypt, password);
- if (error)
+ okay = pdf_setpassword(app->xref->crypt, password);
+ if (!okay)
pdfapp_warn(app, "Invalid password.");
}
}