diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-02-01 11:01:24 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-02-01 11:01:24 +0000 |
commit | d36ddbb53507e45a04ef68b82e77bc224149ae4a (patch) | |
tree | 438a2ac79149a68c65ea8f6f238434596da22b86 /pdf/pdf_cmap.c | |
parent | 3e65ed4eb3a8aa8cd6375a7029ac3b61a35a1157 (diff) | |
download | mupdf-d36ddbb53507e45a04ef68b82e77bc224149ae4a.tar.xz |
Tweak to previous pdf_decode_cmap fix.
More aesthetically pleasing version.
Diffstat (limited to 'pdf/pdf_cmap.c')
-rw-r--r-- | pdf/pdf_cmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c index 587b82e2..c42317bb 100644 --- a/pdf/pdf_cmap.c +++ b/pdf/pdf_cmap.c @@ -482,13 +482,12 @@ pdf_lookup_cmap_full(pdf_cmap *cmap, int cpt, int *out) * Use the codespace ranges to extract a codepoint from a * multi-byte encoded string. */ -unsigned char * -pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt, int *w) +int +pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt) { int k, n, c; c = 0; - *w = 0; for (n = 0; n < 4; n++) { c = (c << 8) | buf[n]; @@ -499,13 +498,12 @@ pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, int *cpt, int *w) if (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high) { *cpt = c; - *w = n + 1; - return buf + n + 1; + return n + 1; } } } } *cpt = 0; - return buf + 1; + return 1; } |