diff --git a/libscan/ebook/ebook.c b/libscan/ebook/ebook.c index 872e44e..67c0e90 100644 --- a/libscan/ebook/ebook.c +++ b/libscan/ebook/ebook.c @@ -102,7 +102,9 @@ int render_cover(scan_ebook_ctx_t *ctx, fz_context *fzctx, document_t *doc, fz_d void fz_err_callback(void *user, const char *message) { document_t *doc = (document_t *) user; - thread_ctx.logf(doc->filepath, LEVEL_WARNING,"FZ: %s", message); + + const scan_ebook_ctx_t *ctx = &thread_ctx; + CTX_LOG_WARNINGF(doc->filepath, "FZ: %s", message); } static void init_fzctx(fz_context *fzctx, document_t *doc) { diff --git a/libscan/mobi/scan_mobi.c b/libscan/mobi/scan_mobi.c index aa87e81..87a4bc5 100644 --- a/libscan/mobi/scan_mobi.c +++ b/libscan/mobi/scan_mobi.c @@ -1,6 +1,7 @@ #include "scan_mobi.h" #include +#include #include "stdlib.h" void parse_mobi(scan_mobi_ctx_t *ctx, vfile_t *f, document_t *doc) { @@ -18,7 +19,7 @@ void parse_mobi(scan_mobi_ctx_t *ctx, vfile_t *f, document_t *doc) { if (file == NULL) { mobi_free(m); free(buf); - CTX_LOG_ERRORF(f->filepath, "fmemopen() failed: %d", ferror(file)) + CTX_LOG_ERRORF(f->filepath, "fmemopen() failed (%d)", errno) return; }