X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/3e2dd889175865f670a2309f757eee3d6a7f4723..refs/heads/master:/in_pf.c diff --git a/in_pf.c b/in_pf.c index 3df6d37..2814445 100644 --- a/in_pf.c +++ b/in_pf.c @@ -71,6 +71,7 @@ static t1_data *load_pfb_file(FILE *fp, filepos *pos) { tail->data = snewn(tail->length, unsigned char); if (fread(tail->data, 1, tail->length, fp) != tail->length) abort(); } + tail->next = NULL; } static t1_data *load_pfa_file(FILE *fp, filepos *pos) { @@ -90,6 +91,7 @@ static t1_data *load_pfa_file(FILE *fp, filepos *pos) { } ret->data = sresize(ret->data, off, unsigned char); ret->length = off; + ret->next = NULL; return ret; } @@ -175,7 +177,7 @@ static void pf_identify(t1_font *tf) { c = pf_getc(pf); if (c == EOF) { sfree(rsc.text); - error(err_pfeof, &tf->pos); + err_pfeof(&tf->pos); return; } rdaddc(&rsc, c); @@ -183,7 +185,7 @@ static void pf_identify(t1_font *tf) { p = rsc.text; if ((p = strchr(p, ':')) == NULL) { sfree(rsc.text); - error(err_pfhead, &tf->pos); + err_pfhead(&tf->pos); return; } p++; @@ -197,11 +199,12 @@ static void pf_identify(t1_font *tf) { for (fi = all_fonts; fi; fi = fi->next) { if (strcmp(fi->name, fontname) == 0) { fi->fontfile = tf; + fi->filetype = TYPE1; sfree(fontname); return; } } - error(err_pfnoafm, &tf->pos, fontname); + err_pfnoafm(&tf->pos, fontname); sfree(fontname); } @@ -249,7 +252,7 @@ static size_t pf_length1(t1_font *tf) { ret = pf_findtoken(tf, 0, "eexec"); if (ret == (size_t)-1) { - error(err_pfeof, &tf->pos); + err_pfeof(&tf->pos); return 0; } return ret; @@ -262,7 +265,7 @@ static size_t pf_length2(t1_font *tf) { tf->length1 = pf_length1(tf); ret = pf_findtoken(tf, tf->length1, "cleartomark"); if (ret == (size_t)-1) { - error(err_pfeof, &tf->pos); + err_pfeof(&tf->pos); return 0; } return ret - 12 - tf->length1; /* backspace over "cleartomark\n" */