aboutsummaryrefslogtreecommitdiff
path: root/src/anastasis/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/anastasis/print.c')
-rw-r--r--src/anastasis/print.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/anastasis/print.c b/src/anastasis/print.c
index 6b4a4c5..c640c71 100644
--- a/src/anastasis/print.c
+++ b/src/anastasis/print.c
@@ -30,19 +30,19 @@
30#include <gnunet/gnunet_util_lib.h> 30#include <gnunet/gnunet_util_lib.h>
31#include "print.h" 31#include "print.h"
32 32
33static jmp_buf env;
34
35 33
36static void 34static void
37error_handler (HPDF_STATUS error_no, 35error_handler (HPDF_STATUS error_no,
38 HPDF_STATUS detail_no, 36 HPDF_STATUS detail_no,
39 void *user_data) 37 void *user_data)
40{ 38{
39 jmp_buf *env = user_data;
40
41 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 41 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
42 "error_no=%04X, detail_no=%u\n", 42 "error_no=%04X, detail_no=%u\n",
43 (HPDF_UINT) error_no, 43 (HPDF_UINT) error_no,
44 (HPDF_UINT) detail_no); 44 (HPDF_UINT) detail_no);
45 longjmp (env, 45 longjmp (*env,
46 1); 46 1);
47} 47}
48 48
@@ -59,8 +59,11 @@ AG_print (json_t *user,
59 HPDF_Page page; 59 HPDF_Page page;
60 float tw; 60 float tw;
61 float fsize; 61 float fsize;
62 jmp_buf env;
63
62 64
63 pdf = HPDF_New (error_handler, NULL); 65 pdf = HPDF_New (&error_handler,
66 &env);
64 if (! pdf) 67 if (! pdf)
65 { 68 {
66 printf ("error: cannot create PdfDoc object\n"); 69 printf ("error: cannot create PdfDoc object\n");
@@ -133,7 +136,7 @@ AG_print (json_t *user,
133 HPDF_Page_GetWidth (page) - 130, 136 HPDF_Page_GetWidth (page) - 130,
134 HPDF_FALSE, 137 HPDF_FALSE,
135 NULL); 138 NULL);
136 if ( (len < strlen (val)) && 139 if ( (len < (ssize_t) strlen (val)) &&
137 (fsize > 10) ) 140 (fsize > 10) )
138 fsize--; 141 fsize--;
139 else 142 else