diff options
Diffstat (limited to 'test/tree2.c')
-rw-r--r-- | test/tree2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/tree2.c b/test/tree2.c index e5a1e94..a56304f 100644 --- a/test/tree2.c +++ b/test/tree2.c @@ -475,11 +475,13 @@ int insert_before(void *ctx, void *parent, void *child, void *ref_child, tchild->next = tref; tref->prev = tchild; - if (tref->prev) - tref->prev->next = tchild; + if (tchild->prev) + tchild->prev->next = tchild; else tparent->child = tchild; + *result = child; + return 0; } |