From f20956ff1bdfb266ae9c690bd2961acf7b3f4845 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 24 Jun 2021 19:12:25 +0200 Subject: composed: insert: require key to be unique --- vt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'vt.c') diff --git a/vt.c b/vt.c index 94bd6685..7c77f7ec 100644 --- a/vt.c +++ b/vt.c @@ -761,11 +761,13 @@ action_utf8_print(struct terminal *term, wchar_t wc) new_cc->width = grapheme_width; term->composed_count++; - key = composed_insert(&term->composed, new_cc); - wc = CELL_COMB_CHARS_LO + key; - xassert(wc <= CELL_COMB_CHARS_HI); + composed_insert(&term->composed, new_cc); + wc = CELL_COMB_CHARS_LO + key; width = grapheme_width; + + xassert(wc >= CELL_COMB_CHARS_LO); + xassert(wc <= CELL_COMB_CHARS_HI); goto out; } } -- cgit v1.3