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. --- source/fitz/stext-search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/fitz/stext-search.c') diff --git a/source/fitz/stext-search.c b/source/fitz/stext-search.c index bba2c3f5..8d768a4f 100644 --- a/source/fitz/stext-search.c +++ b/source/fitz/stext-search.c @@ -280,7 +280,7 @@ fz_copy_selection(fz_context *ctx, fz_stext_page *page, fz_rect rect) fz_write_buffer_byte(ctx, buffer, 0); - s = (char*)buffer->data; - fz_free(ctx, buffer); + fz_buffer_extract(ctx, buffer, &s); + fz_drop_buffer(ctx, buffer); return s; } -- cgit v1.2.3