From 86a65e695b9dc1fb7a20094204339f5bf168fb92 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 25 Aug 2026 20:56:55 +0000 Subject: Start working on modules, including a built-in "boot" module FossilOrigin-Name: 4829dbeb2071fe0be41ded66a61ba2e156119a47def8a23415b8227a00d53ce7 --- src/lib/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/string.c') diff --git a/src/lib/string.c b/src/lib/string.c index 123e81b..ecac9d7 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -1,7 +1,7 @@ #include "aplwc_internal.h" struct string * -chars_to_string(struct aplwc *aplwc, const char *chars) +chars_to_string(struct aplwc *aplwc, const char *chars, int len) { const uint8_t *utf8; size_t bytecount, charcount; @@ -12,7 +12,7 @@ chars_to_string(struct aplwc *aplwc, const char *chars) utf8 = (const uint8_t *)chars; seqlen = extra = 0; - for(bytecount = 0, charcount = 0; utf8[bytecount]; bytecount++){ + for(bytecount = 0, charcount = 0; ((bytecount < (unsigned int)len) || (len == -1)) && utf8[bytecount]; bytecount++){ b = utf8[bytecount]; if(extra == 0){ c = 0; -- cgit v1.2.3