summaryrefslogtreecommitdiff
path: root/std/stack.zc
diff options
context:
space:
mode:
authorZuhaitz <zuhaitz.zechhub@gmail.com>2026-01-21 22:52:06 +0000
committerGitHub <noreply@github.com>2026-01-21 22:52:06 +0000
commitf912e071eaaa362b369626d7312589d4c9ac311b (patch)
treee71dc7af4ce01d135dee819cc10fc1eb04fb023f /std/stack.zc
parent260f01af1d3c19827d175740e30da57a288a6e86 (diff)
parent284d68b397abf68b664cbd9c8551aa8b62c5c1fc (diff)
Merge pull request #86 from Burnett01/fix/queue-stack-memcpy-only-valid-data
Fix/queue stack memcpy only valid data
Diffstat (limited to 'std/stack.zc')
-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;
}