From 33d6537570a982bf347f579fa01c432c065e80d1 Mon Sep 17 00:00:00 2001 From: Paper Date: Sun, 16 Mar 2025 00:57:22 -0400 Subject: [PATCH 1/2] fix improper integer type on systems with non-32-bit int --- utf8proc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utf8proc.c b/utf8proc.c index 29e92ea..154ea86 100644 --- a/utf8proc.c +++ b/utf8proc.c @@ -524,9 +524,12 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, } } if (options & UTF8PROC_CHARBOUND) { + /* hack for systems with int that isn't 32-bit */ + utf8proc_int32_t last_boundclass_hack; utf8proc_bool boundary; boundary = grapheme_break_extended(0, property->boundclass, 0, property->indic_conjunct_break, - last_boundclass); + &last_boundclass_hack); + *last_boundclass = last_boundclass_hack; if (boundary) { if (bufsize >= 1) dst[0] = -1; /* sentinel value for grapheme break */ if (bufsize >= 2) dst[1] = uc; From 34eb3ea517c2df6ce2173693059e77a39c4f4189 Mon Sep 17 00:00:00 2001 From: Paper Date: Sun, 16 Mar 2025 03:39:07 -0400 Subject: [PATCH 2/2] okay, what's in that variable actually DOES matter --- utf8proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utf8proc.c b/utf8proc.c index 154ea86..7003d90 100644 --- a/utf8proc.c +++ b/utf8proc.c @@ -525,7 +525,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, } if (options & UTF8PROC_CHARBOUND) { /* hack for systems with int that isn't 32-bit */ - utf8proc_int32_t last_boundclass_hack; + utf8proc_int32_t last_boundclass_hack = *last_boundclass; utf8proc_bool boundary; boundary = grapheme_break_extended(0, property->boundclass, 0, property->indic_conjunct_break, &last_boundclass_hack);