aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libparsepsf.c')
-rw-r--r--libparsepsf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libparsepsf.c b/libparsepsf.c
index 485cce1..a3be5f3 100644
--- a/libparsepsf.c
+++ b/libparsepsf.c
@@ -417,14 +417,14 @@ libparsepsf_get_glyph(const struct libparsepsf_font *font, const char *c, size_t
errno = EILSEQ;
return 0;
}
- if (remp)
- rem = *remp - n;
- c = &c[n];
glyph = (size_t)cp;
if (glyph >= font->num_glyphs)
return 0;
- glyph += 1;
- goto out;
+ if (next_cp)
+ *next_cp = &c[n];
+ if (remp)
+ *remp = *remp - n;
+ return glyph + 1;
} else if (remp) {
rem = *remp;
@@ -459,7 +459,6 @@ libparsepsf_get_glyph(const struct libparsepsf_font *font, const char *c, size_t
}
glyph = node->terminal[*(const uint8_t *)c];
-out:
if (glyph) {
if (next_cp)
*next_cp = &c[1];