about summary refs log tree commit diff
path: root/misc/tsearch.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tsearch.c')
-rw-r--r--misc/tsearch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/misc/tsearch.c b/misc/tsearch.c
index c5af3ec689..0cf854b8bc 100644
--- a/misc/tsearch.c
+++ b/misc/tsearch.c
@@ -359,8 +359,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
 	  node **newstack;
 	  stacksize += 20;
 	  newstack = alloca (sizeof (node *) * stacksize);
-	  memcpy (newstack, nodestack, sp * sizeof (node *));
-	  nodestack = newstack;
+	  nodestack = memcpy (newstack, nodestack, sp * sizeof (node *));
 	}
 
       nodestack[sp++] = rootp;
@@ -398,8 +397,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
 	      node **newstack;
 	      stacksize += 20;
 	      newstack = alloca (sizeof (node *) * stacksize);
-	      memcpy (newstack, nodestack, sp * sizeof (node *));
-	      nodestack = newstack;
+	      nodestack = memcpy (newstack, nodestack, sp * sizeof (node *));
 	    }
 	  nodestack[sp++] = parent;
 	  parent = up;