From 4184ba5d2930b337fddf3ad8e612a88adb08d8c1 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 5 Apr 2012 12:48:19 +0100 Subject: Don't unlock a lock we don't own. While debugging Bug 692943, I spotted a case where we can attempt to unlock the file while we don't hold the file lock due to an error being thrown while we momentarily drop that lock. Simple solution is to add a new fz_try()/fz_catch() to retake the lock in such an error circumstance. --- apps/pdfapp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 55cecb16..8fca5713 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -310,7 +310,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai sprintf(buf2, " - %d/%d (%d dpi)", app->pageno, app->pagecount, app->resolution); len = MAX_TITLE-strlen(buf2); - if (strlen(app->doctitle) > len) + if ((int)strlen(app->doctitle) > len) { snprintf(buf, len-3, "%s", app->doctitle); strcat(buf, "..."); -- cgit v1.2.3