aboutsummaryrefslogtreecommitdiffstats
path: root/src/ztrunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ztrunc.c')
-rw-r--r--src/ztrunc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ztrunc.c b/src/ztrunc.c
index f86fb8e..c634707 100644
--- a/src/ztrunc.c
+++ b/src/ztrunc.c
@@ -19,7 +19,7 @@ ztrunc(z_t a, z_t b, size_t bits)
if (a->used < chars)
bits = 0;
if (a != b) {
- ENSURE_SIZE(a, b->alloced);
+ ENSURE_SIZE(a, a->used);
zmemcpy(a->chars, b->chars, a->used);
}
bits = BITS_IN_LAST_CHAR(bits);