From 8521b6a69deab8cdabe1c87b09ecdc93d75af98e Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 30 Aug 2026 14:20:55 +0000 Subject: Remove the struct memory struct FossilOrigin-Name: 38568a34f631b2a4eef72542e2988a9fe081f85d3248194c2ff995a9eed6bd5d --- src/lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/string.c') diff --git a/src/lib/string.c b/src/lib/string.c index 24f978c..d10fb1f 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -69,7 +69,7 @@ invalid: if(extra != 0) goto invalid; - string = memory_alloc_string(&aplwc->memory, bytecount); + string = memory_alloc_string(aplwc, bytecount); if(string){ string->bytes = bytecount; string->chars = charcount; -- cgit v1.2.3 From 2261ffa04ddf30a7c8eae6e64129b293fc8bffd9 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 30 Aug 2026 14:25:56 +0000 Subject: Let the memory allocation code set the last_error to APLWC_OUT_OF_MEMORY, instead of the callers FossilOrigin-Name: 46c74e207a84e861636dbfebc4ba8bb9e7b17401dfd2c4fb9bdeae0fa98fd530 --- src/lib/string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib/string.c') diff --git a/src/lib/string.c b/src/lib/string.c index d10fb1f..cc6c6cb 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -74,8 +74,7 @@ invalid: string->bytes = bytecount; string->chars = charcount; memcpy(string->utf8, utf8, bytecount); - }else - aplwc->last_error = APLWC_OUT_OF_MEMORY; + } return string; } -- cgit v1.2.3