aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoryzrh <yzrh@noema.org>2021-01-11 23:25:30 +0000
committeryzrh <yzrh@noema.org>2021-01-12 02:26:39 +0000
commitf685e91d351ffafd40a11c10d3b88ef78634f015 (patch)
treefa73bf6afb09e0c272a3ba7fe67d332d3a8088de /src
parent2aab3946845a4e177c211883c39ebda3c180095d (diff)
downloadmelon-f685e91d351ffafd40a11c10d3b88ef78634f015.tar.gz
melon-f685e91d351ffafd40a11c10d3b88ef78634f015.tar.zst
Fix HN dictionary generation.
Diffstat (limited to 'src')
-rw-r--r--src/cnki_pdf.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cnki_pdf.c b/src/cnki_pdf.c
index 8637672..ac4e34a 100644
--- a/src/cnki_pdf.c
+++ b/src/cnki_pdf.c
@@ -559,7 +559,7 @@ cnki_pdf_hn(cnki_t **param)
if (ret == 0) {
if ((*param)->stat > 2)
- printf("Succeed\n");
+ printf("Done\n");
pdf_obj_append(&pdf, ids[i],
NULL, dictionary, stream, stream_size);
@@ -567,9 +567,6 @@ cnki_pdf_hn(cnki_t **param)
free(dictionary);
free(stream);
} else if (ret == 1) {
- if ((*param)->stat > 2)
- printf("; Failed\n");
-
free(dictionary);
pdf_obj_append(&pdf, ids[i], NULL, NULL, NULL, 0);
@@ -860,8 +857,6 @@ cnki_pdf_hn(cnki_t **param)
return 1;
}
- memset(dictionary, 0, dictionary_size);
-
pdf_object_t *tmp = NULL;
/* Add /Parent to page object */
@@ -874,7 +869,7 @@ cnki_pdf_hn(cnki_t **param)
memset(dictionary, 0, dictionary_size);
- strcat(dictionary, tmp->dictionary);
+ memcpy(dictionary, tmp->dictionary, tmp->dictionary_size);
snprintf(buf, 64, "/Parent %d 0 R\n>>", root);
strcat(dictionary, buf);