From 33489655a7244fac71ad3ccce8a96e69c61b85ee Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 21 Dec 2025 15:01:37 +0100 Subject: Use LIBCMAP_RANGE_SIZE, and do not *offset_out and *subrange_out when the codepoint is not found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libcmap_find_script.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libcmap_find_script.c') diff --git a/libcmap_find_script.c b/libcmap_find_script.c index 844188e..ea39932 100644 --- a/libcmap_find_script.c +++ b/libcmap_find_script.c @@ -18,12 +18,8 @@ libcmap_find_script(uint32_t codepoint, size_t *offset_out, size_t *subrange_out *subrange_out = j; return &list[i]; } - skipped += (size_t)(list[i].ranges[j].last - list[i].ranges[j].first) + 1U; + skipped += LIBCMAP_RANGE_SIZE(&list[i].ranges[j]); } } - if (offset_out) - *offset_out = (size_t)codepoint; - if (subrange_out) - *subrange_out = 0; return NULL; } -- cgit v1.3.1