aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_decode_font_description.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-11-21 09:30:54 +0100
committerMattias Andrée <maandree@kth.se>2021-11-21 09:30:54 +0100
commitd091e2355276a8632c5bc1c296189ad0aac2673b (patch)
tree8b7509757f06c697e32c9e2a7bfebf5a72190c2a /libfonts_decode_font_description.c
parentImplement libfonts_decode_font_description (diff)
downloadlibfonts-d091e2355276a8632c5bc1c296189ad0aac2673b.tar.gz
libfonts-d091e2355276a8632c5bc1c296189ad0aac2673b.tar.bz2
libfonts-d091e2355276a8632c5bc1c296189ad0aac2673b.tar.xz
Fix union of overlapping charset subset ranges
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libfonts_decode_font_description.c')
-rw-r--r--libfonts_decode_font_description.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libfonts_decode_font_description.c b/libfonts_decode_font_description.c
index 329d338..83cf5c2 100644
--- a/libfonts_decode_font_description.c
+++ b/libfonts_decode_font_description.c
@@ -118,7 +118,8 @@ fix_charset_subset(char *out, const char *in)
saved = ranges[0];
for (i = 1; i < n; i++) {
if (ranges[i].first <= saved.last) {
- saved.last = ranges[i].last;
+ if (ranges[i].last > saved.last)
+ saved.last = ranges[i].last;
} else {
if (saved.first == saved.last)
out += sprintf(out, "%"PRId32" ", saved.first);