From 45f0261cfa26628fbde3458f5b0f513a6192a4f0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 Jul 2022 18:10:39 +0200 Subject: Fix value of *unrecognised_versionp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libparsepsf.c | 2 +- libparsepsf.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libparsepsf.c b/libparsepsf.c index a3be5f3..67e7158 100644 --- a/libparsepsf.c +++ b/libparsepsf.c @@ -326,7 +326,7 @@ libparsepsf_parse_font(const void *data, size_t size, struct libparsepsf_font *f if (header.psf2.height * ((header.psf2.width + 7) / 8) != header.psf2.charsize) goto ebfont; if (header.psf2.version > PSF2_MAXVERSION) - *unrecognised_versionp = 1; + *unrecognised_versionp = header.psf2.version; fontp->num_glyphs = (size_t)header.psf2.num_glyphs; fontp->height = (size_t)header.psf2.height; fontp->width = (size_t)header.psf2.width; diff --git a/libparsepsf.h b/libparsepsf.h index 5a0b219..74b229b 100644 --- a/libparsepsf.h +++ b/libparsepsf.h @@ -88,8 +88,8 @@ void libparsepsf_destroy_font(struct libparsepsf_font *font); * @param fontp Output parameter for the font, should be deallocated * using `libparsepsf_destroy_font` when no longer * needed (only allocated on success completion) - * @param unrecognised_versionp Normally set to 0; set to 1 if the minor version in - * the font file is unrecognised (backwards-compatibility + * @param unrecognised_versionp Normally set to 0; set to the minor version in the + * font file if it is unrecognised (backwards-compatibility * is assumed, so it will still be parsed as a supported * font file) * @return 0 on successful completion, -1 on failure -- cgit v1.2.3-70-g09d2