diff options
| author | Mattias Andrée <m@maandree.se> | 2025-12-21 15:01:37 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2025-12-21 15:01:37 +0100 |
| commit | 33489655a7244fac71ad3ccce8a96e69c61b85ee (patch) | |
| tree | 5598807302d06eea4400b7826e6d9b7de679ebc1 /libcmap_find_script.c | |
| parent | Add LIBCMAP_RANGE_SIZE (diff) | |
| download | libcmap-33489655a7244fac71ad3ccce8a96e69c61b85ee.tar.gz libcmap-33489655a7244fac71ad3ccce8a96e69c61b85ee.tar.bz2 libcmap-33489655a7244fac71ad3ccce8a96e69c61b85ee.tar.xz | |
Use LIBCMAP_RANGE_SIZE, and do not *offset_out and *subrange_out when the codepoint is not found
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcmap_find_script.c')
| -rw-r--r-- | libcmap_find_script.c | 6 |
1 files changed, 1 insertions, 5 deletions
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; } |
