From eec0706333ecf28898b1879cae5dab791b307cf6 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Mon, 2 Sep 2024 23:25:08 +0200 Subject: Support libunistring versions before 1.2 --- nncmpp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nncmpp.c') diff --git a/nncmpp.c b/nncmpp.c index f306f5c..9c6f86f 100644 --- a/nncmpp.c +++ b/nncmpp.c @@ -5911,9 +5911,9 @@ x11_render_editor (struct widget *self) // TODO: Make this scroll around the caret, and fade like labels. size_t len; ucs4_t *buf = xcalloc (e->len + 1, sizeof *buf); - *u32_pcpy (buf, e->line, e->point) = 0; + u32_cpy (buf, e->line, e->point); char *a = (char *) u32_to_u8 (buf, u32_strlen (buf) + 1, NULL, &len); - *u32_pcpy (buf, e->line + e->point, e->len - e->point) = 0; + u32_cpy (buf, e->line + e->point, e->len - e->point + 1); char *b = (char *) u32_to_u8 (buf, u32_strlen (buf) + 1, NULL, &len); free (buf); -- cgit v1.2.3-70-g09d2