From 7f7a2fb4fb23433e7be3d6953725690c8ea958d2 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 31 Aug 2026 19:44:56 +0000 Subject: The objects returned to the user are now integer-based references, not actual pointers. This means the aplwc internals can update those pointers without the user noticing. FossilOrigin-Name: 654c7d0ec85da295a7fb6ed381500410686b280f342fa81a30481f5e9a20c58a --- tests/aplwc_errstr.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/aplwc_errstr.c') diff --git a/tests/aplwc_errstr.c b/tests/aplwc_errstr.c index 1a5ebc4..fe9fa0e 100644 --- a/tests/aplwc_errstr.c +++ b/tests/aplwc_errstr.c @@ -20,19 +20,19 @@ my_dealloc(void *p) int main(void) { + enum aplwc_rc ret; struct aplwc_fns fns; struct aplwc *aplwc; - int ret, success; + int success; const char *err; success = 0; - aplwc = NULL; memset(&fns, 0, sizeof(fns)); fns.alloc = my_alloc; fns.dealloc = my_dealloc; - ret = aplwc_new(&aplwc, fns); + aplwc = aplwc_new(fns, &ret); if(ret) goto end; @@ -50,10 +50,9 @@ main(void) goto end; aplwc_destroy(aplwc); - aplwc = NULL; fns.alloc = NULL; - ret = aplwc_new(&aplwc, fns); + aplwc = aplwc_new(fns, &ret); if(ret == 0) goto end; err = aplwc_errstr_rc(ret); -- cgit v1.2.3