summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/stack.zc2
1 files changed, 1 insertions, 1 deletions
diff --git a/std/stack.zc b/std/stack.zc
index 7df77f1..db02f2d 100644
--- a/std/stack.zc
+++ b/std/stack.zc
@@ -25,7 +25,7 @@ impl Stack<T> {
new_stack.len = self.len;
new_stack.cap = self.cap;
new_stack.data = malloc(sizeof(T) * new_stack.cap);
- memcpy(new_stack.data, self.data, sizeof(T) * new_stack.cap);
+ memcpy(new_stack.data, self.data, sizeof(T) * new_stack.len);
return new_stack;
}