Revamp of the Halibut error handling mechanism.
[sgt/halibut] / in_pf.c
diff --git a/in_pf.c b/in_pf.c
index 0867376..2814445 100644 (file)
--- 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++;
@@ -202,7 +204,7 @@ static void pf_identify(t1_font *tf) {
            return;
        }
     }
-    error(err_pfnoafm, &tf->pos, fontname);
+    err_pfnoafm(&tf->pos, fontname);
     sfree(fontname);
 }
 
@@ -250,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;
@@ -263,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" */