diff options
author | Mattias Andrée <maandree@kth.se> | 2022-07-17 16:35:42 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2022-07-17 16:35:42 +0200 |
commit | 4325ec3bbc1e06200d91bc79686051bd1b0b9ddb (patch) | |
tree | f18be234e0f31caa1f97cdfd6d8e9c88942a8492 /libparsepsf.c | |
parent | Update copyright year (diff) | |
download | libparsepsf-4325ec3bbc1e06200d91bc79686051bd1b0b9ddb.tar.gz libparsepsf-4325ec3bbc1e06200d91bc79686051bd1b0b9ddb.tar.bz2 libparsepsf-4325ec3bbc1e06200d91bc79686051bd1b0b9ddb.tar.xz |
Fix two bugs and add documentation
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libparsepsf.c')
-rw-r--r-- | libparsepsf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libparsepsf.c b/libparsepsf.c index 9649f63..485cce1 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 = 0; + *unrecognised_versionp = 1; fontp->num_glyphs = (size_t)header.psf2.num_glyphs; fontp->height = (size_t)header.psf2.height; fontp->width = (size_t)header.psf2.width; @@ -423,7 +423,7 @@ libparsepsf_get_glyph(const struct libparsepsf_font *font, const char *c, size_t glyph = (size_t)cp; if (glyph >= font->num_glyphs) return 0; - glyph -= 1; + glyph += 1; goto out; } else if (remp) { |