summaryrefslogtreecommitdiff
path: root/source/xps
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-11 16:05:30 +0000
committerRobin Watts <robin.watts@artifex.com>2016-11-14 16:09:39 +0000
commit37f95f87bdfb2e0b01d649afae5fffe60bf99d3a (patch)
treeda3491c62d6af86c1a5bc4e523e8f9ebe19793d1 /source/xps
parentc0e1dfdab1a13def046e94d771f8a821ba2a10d9 (diff)
downloadmupdf-37f95f87bdfb2e0b01d649afae5fffe60bf99d3a.tar.xz
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.
Diffstat (limited to 'source/xps')
-rw-r--r--source/xps/xps-zip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c
index ba9947c7..53ea15f9 100644
--- a/source/xps/xps-zip.c
+++ b/source/xps/xps-zip.c
@@ -95,10 +95,9 @@ xps_read_part(fz_context *ctx, xps_document *doc, char *partname)
fz_write_buffer_byte(ctx, buf, 0); /* zero-terminate */
/* take over the data */
- data = buf->data;
/* size doesn't include the added zero-terminator */
- size = buf->len - 1;
- fz_free(ctx, buf);
+ size = fz_buffer_extract(ctx, buf, &data) - 1;
+ fz_drop_buffer(ctx, buf);
return xps_new_part(ctx, doc, partname, data, size);
}