From 1d899d934d26a5e19333712deb50c39b3843076d Mon Sep 17 00:00:00 2001 From: yzrh Date: Fri, 30 Dec 2022 20:16:53 +0000 Subject: Fix PDF object check. Signed-off-by: yzrh --- src/cnki_pdf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cnki_pdf.c b/src/cnki_pdf.c index 45f5324..72500ab 100644 --- a/src/cnki_pdf.c +++ b/src/cnki_pdf.c @@ -328,7 +328,9 @@ cnki_pdf(cnki_t **param) printf("Root object is %d.\n", root); } - if (pdf_get_obj(&pdf, root, NULL) != 0) { + pdf_object_t *tmp; + + if (pdf_get_obj(&pdf, root, &tmp) != 0) { if ((*param)->stat > 0) printf("Root object is missing\n"); @@ -423,8 +425,6 @@ cnki_pdf(cnki_t **param) if ((*param)->stat > 1) printf("Deleting xref object\n"); - pdf_object_t *tmp; - pdf_get_obj(&pdf, xref, &tmp); pdf_obj_del(&pdf, xref); @@ -1106,7 +1106,7 @@ cnki_pdf_hn(cnki_t **param) return 1; } - pdf_object_t *tmp = NULL; + pdf_object_t *tmp; /* Add /Parent to page object */ for (int i = 0; i < (*param)->file_stat->page; i++) { -- cgit v1.2.3