aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepcf_get_bitmap_offsets.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-13 11:17:48 +0200
committerMattias Andrée <m@maandree.se>2024-10-13 11:17:48 +0200
commita81c96c0348af8caf6ae45e2d942a676792a2a31 (patch)
tree24cc725efa3eba381c98ebed7cb2cbf7e0e34f0c /libparsepcf_get_bitmap_offsets.c
parentUpdate e-mail (diff)
downloadlibparsepcf-a81c96c0348af8caf6ae45e2d942a676792a2a31.tar.gz
libparsepcf-a81c96c0348af8caf6ae45e2d942a676792a2a31.tar.bz2
libparsepcf-a81c96c0348af8caf6ae45e2d942a676792a2a31.tar.xz
Documentation and minor improvements
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libparsepcf_get_bitmap_offsets.c')
-rw-r--r--libparsepcf_get_bitmap_offsets.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libparsepcf_get_bitmap_offsets.c b/libparsepcf_get_bitmap_offsets.c
index 192b07b..8f62f7e 100644
--- a/libparsepcf_get_bitmap_offsets.c
+++ b/libparsepcf_get_bitmap_offsets.c
@@ -3,11 +3,12 @@
int
-libparsepcf_get_bitmap_offsets(const char *file, size_t size,
+libparsepcf_get_bitmap_offsets(const void *file, size_t size,
const struct libparsepcf_table *table,
const struct libparsepcf_bitmaps *meta,
- size_t *out, size_t first, size_t count)
+ size_t *offs, size_t first, size_t count)
{
+ const char *text = file;
int msb = table->format & LIBPARSEPCF_BYTE;
size_t pos = table->offset + 8 + first * 4;
size_t i;
@@ -15,8 +16,8 @@ libparsepcf_get_bitmap_offsets(const char *file, size_t size,
(void) size;
for (i = 0; i < count; i++, pos += 4) {
- out[i] = (size_t)PARSE_UINT32(&file[pos + 0], msb);
- if (out[i] > meta->bitmap_size)
+ offs[i] = (size_t)PARSE_UINT32(&text[pos + 0], msb);
+ if (offs[i] > meta->bitmap_size)
goto ebfont;
}