aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepcf_get_swidth_count.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libparsepcf_get_swidth_count.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libparsepcf_get_swidth_count.c b/libparsepcf_get_swidth_count.c
index 90a5f4a..f6010d0 100644
--- a/libparsepcf_get_swidth_count.c
+++ b/libparsepcf_get_swidth_count.c
@@ -3,8 +3,11 @@
int
-libparsepcf_get_swidth_count(const char *file, size_t size, const struct libparsepcf_table *table, size_t *countp)
+libparsepcf_get_swidth_count(const void *file, size_t size,
+ const struct libparsepcf_table *table,
+ size_t *count)
{
+ const char *text = file;
size_t pos;
int msb = table->format & LIBPARSEPCF_BYTE;
@@ -13,14 +16,14 @@ libparsepcf_get_swidth_count(const char *file, size_t size, const struct libpars
pos = table->offset;
- if (table->format != libparsepcf_parse_lsb_uint32__(&file[pos]))
+ if (table->format != libparsepcf_parse_lsb_uint32__(&text[pos]))
goto ebfont;
pos += 4;
- *countp = (size_t)PARSE_UINT32(&file[pos], msb);
+ *count = (size_t)PARSE_UINT32(&text[pos], msb);
pos += 4;
- if (*countp > (size - pos) / 4)
+ if (*count > (size - pos) / 4)
goto ebfont;
return 0;