aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-10-16 17:57:25 +0200
committerMattias Andrée <m@maandree.se>2026-10-16 17:57:25 +0200
commite2b4d40486cd1fe22e6a031b610918e39966bf23 (patch)
tree485faf7b7f88431afb4dbdef195f3e83838eac0b
parentStyle improvement (diff)
downloadlibcmap-e2b4d40486cd1fe22e6a031b610918e39966bf23.tar.gz
libcmap-e2b4d40486cd1fe22e6a031b610918e39966bf23.tar.bz2
libcmap-e2b4d40486cd1fe22e6a031b610918e39966bf23.tar.xz
Fix libcmap_find_block and libcmap_find_script
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--libcmap_find_block.c2
-rw-r--r--libcmap_find_script.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libcmap_find_block.c b/libcmap_find_block.c
index 73071c7..fabf8f1 100644
--- a/libcmap_find_block.c
+++ b/libcmap_find_block.c
@@ -8,7 +8,7 @@ libcmap_find_block(uint32_t codepoint, size_t *offset_out)
const struct libcmap_block *list = libcmap_block_list;
size_t i, n = libcmap_block_list_size;
for (i = 0; i < n; i++) {
- if (list[i].range.first <= codepoint && list[i].range.last <= codepoint) {
+ if (list[i].range.first <= codepoint && codepoint <= list[i].range.last) {
if (offset_out)
*offset_out = (size_t)(codepoint - list[i].range.first);
return &list[i];
diff --git a/libcmap_find_script.c b/libcmap_find_script.c
index ea39932..7bac658 100644
--- a/libcmap_find_script.c
+++ b/libcmap_find_script.c
@@ -11,7 +11,7 @@ libcmap_find_script(uint32_t codepoint, size_t *offset_out, size_t *subrange_out
for (i = 0; i < n; i++) {
skipped = 0;
for (j = 0; j < list[i].nranges; j++) {
- if (list[i].ranges[j].first <= codepoint && list[i].ranges[j].last <= codepoint) {
+ if (list[i].ranges[j].first <= codepoint && codepoint <= list[i].ranges[j].last) {
if (offset_out)
*offset_out = skipped + (size_t)(codepoint - list[i].ranges[j].first);
if (subrange_out)