summaryrefslogtreecommitdiff
path: root/tests/aplwc_errstr.c
diff options
context:
space:
mode:
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);