From 37f95f87bdfb2e0b01d649afae5fffe60bf99d3a Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 11 Nov 2016 16:05:30 +0000 Subject: Make fz_buffer structure private to fitz. Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings. --- platform/x11/pdfapp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'platform/x11/pdfapp.c') diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 58a50db5..ce059651 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -282,8 +282,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) if (app->layout_css) { fz_buffer *buf = fz_read_file(ctx, app->layout_css); - fz_write_buffer_byte(ctx, buf, 0); - fz_set_user_css(ctx, (char*)buf->data); + fz_set_user_css(ctx, fz_string_from_buffer(ctx, buf)); fz_drop_buffer(ctx, buf); } -- cgit v1.2.3