From 55afc5a5fd93f4e45aeab7f08ed8faee86377d12 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 12 Oct 2024 13:29:23 -0400 Subject: Further progress and bugfixes --- stdlib/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stdlib') diff --git a/stdlib/text.c b/stdlib/text.c index 96b0c2cd..0af95413 100644 --- a/stdlib/text.c +++ b/stdlib/text.c @@ -629,7 +629,7 @@ public Text_t Text$from_strn(const char *str, size_t len) ucs4_t buf[128]; size_t length = sizeof(buf)/sizeof(buf[0]); - ucs4_t *codepoints = u8_to_u32((uint8_t*)str, (size_t)ascii_span + strlen(str + ascii_span), buf, &length); + ucs4_t *codepoints = u8_to_u32((uint8_t*)str, len, buf, &length); Text_t ret = text_from_u32(codepoints, (int64_t)length, true); if (codepoints != buf) free(codepoints); return ret; -- cgit v1.2.3