aboutsummaryrefslogtreecommitdiffstats
path: root/src/zrsh.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-04 10:45:10 +0100
committerMattias Andrée <maandree@kth.se>2016-03-04 10:47:53 +0100
commitaff09967d194d062ae8d83c0fbe1edf158804ef9 (patch)
tree793f32bc01e780bb6457570f9ea7a8e7ff94f7bb /src/zrsh.c
parentAdd makefile and fix errors (diff)
downloadlibzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.gz
libzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.bz2
libzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.xz
Clean up, fix a few bugs, and add a test
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/zrsh.c')
-rw-r--r--src/zrsh.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/zrsh.c b/src/zrsh.c
index c3bd63e..c5a1a05 100644
--- a/src/zrsh.c
+++ b/src/zrsh.c
@@ -27,8 +27,7 @@ zrsh(z_t a, z_t b, size_t bits)
zmemmove(a->chars, a->chars + chars, a->used);
} else if (a != b) {
a->used = b->used - chars;
- if (a->alloced < a->used)
- zahl_realloc(a, a->used);
+ ENSURE_SIZE(a, a->used);
zmemcpy(a->chars, b->chars + chars, a->used);
}