summaryrefslogtreecommitdiff
path: root/tests/aplwc_errstr.c
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-08-31 19:44:56 +0000
committerpeter <peter@pmikkelsen.com>2026-08-31 19:44:56 +0000
commit7f7a2fb4fb23433e7be3d6953725690c8ea958d2 (patch)
treee73bc6f3bd9d5132a0262966cd99986027142144 /tests/aplwc_errstr.c
parent729964bea692f9683860978b89848784a7fc2f46 (diff)
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
Diffstat (limited to 'tests/aplwc_errstr.c')
-rw-r--r--tests/aplwc_errstr.c9
1 files changed, 4 insertions, 5 deletions
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);