From 210d6ad784d55362d24a22cd7e07725a794d46cd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 5 Aug 2021 17:30:53 +0200 Subject: minor fixes and cleanups, and update to use new version of libgrapheme and add text length parameter instead of using NUL-termination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libskrift_merge_glyphs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libskrift_merge_glyphs.c') diff --git a/libskrift_merge_glyphs.c b/libskrift_merge_glyphs.c index 4df6f7a..820d0d4 100644 --- a/libskrift_merge_glyphs.c +++ b/libskrift_merge_glyphs.c @@ -20,7 +20,7 @@ libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *ctx, const struct libskrift_glyph *gly glyph2 = t; } if (!(glyph2->width | glyph2->height)) { - size = offsetof(struct libskrift_glyph, image) + glyph1->size; + size = FLEXSTRUCTSIZE(struct libskrift_glyph, image, glyph1->size); *glyphp = calloc(1, size); if (!*glyphp) return -1; @@ -47,7 +47,7 @@ libskrift_merge_glyphs(LIBSKRIFT_CONTEXT *ctx, const struct libskrift_glyph *gly size *= width = (uint16_t)(x2 - x1); size *= height = (uint16_t)(y2 - y1); - *glyphp = calloc(1, offsetof(struct libskrift_glyph, image) + size); + *glyphp = calloc(1, FLEXSTRUCTSIZE(struct libskrift_glyph, image, size)); if (!*glyphp) return -1; -- cgit v1.2.3-70-g09d2