summaryrefslogtreecommitdiffstats
path: root/utf8-combined.c
diff options
context:
space:
mode:
authornicm <nicm>2023-09-01 18:43:54 +0000
committernicm <nicm>2023-09-01 18:43:54 +0000
commit579829eef233ec927d9c71692fd880ddef66c2e7 (patch)
treeefd2b2d5ae941256c55bd6cc068dc15793af6319 /utf8-combined.c
parentf78279bb2ef98ce7aa36928e461b3d0a98a6ddd9 (diff)
Only compare the actual size of the UTF-8 character, not all of it.
Diffstat (limited to 'utf8-combined.c')
-rw-r--r--utf8-combined.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8-combined.c b/utf8-combined.c
index e1b7934f..49f7a648 100644
--- a/utf8-combined.c
+++ b/utf8-combined.c
@@ -962,7 +962,7 @@ utf8_combined_first_cmp(struct utf8_combined_first *uf1,
return (-1);
if (ud1->size > ud2->size)
return (1);
- return (memcmp(ud1->data, ud2->data, sizeof *ud1->data));
+ return (memcmp(ud1->data, ud2->data, ud1->size));
}
RB_HEAD(utf8_combined_tree, utf8_combined_first);
RB_GENERATE_STATIC(utf8_combined_tree, utf8_combined_first, entry,
@@ -979,7 +979,7 @@ utf8_combined_second_cmp(const void *vp1, const void *vp2)
return (-1);
if (ud1->size > ud2->size)
return (1);
- return (memcmp(ud1->data, ud2->data, sizeof *ud1->data));
+ return (memcmp(ud1->data, ud2->data, ud1->size));
}
static int
@@ -1035,7 +1035,7 @@ utf8_build_combined(void)
wc = utf8_combined_table[i].first;
mlen = wctomb(first.data, wc);
if (mlen <= 0 || mlen > UTF8_SIZE) {
- log_debug("invalid combined character %08X", wc);
+ log_debug("invalid combined character %05X", wc);
continue;
}
first.size = mlen;