From 5860237d2f05f6ae45a98569b0d567c2227904c6 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Mar 2016 20:16:14 +0100 Subject: Fix bugs and add a randomised testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/zload.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/zload.c') diff --git a/src/zload.c b/src/zload.c index a77ae57..3ab939d 100644 --- a/src/zload.c +++ b/src/zload.c @@ -8,12 +8,9 @@ zload(z_t a, const void *buffer) const char *buf = buffer; a->sign = *((const int *)buf), buf += sizeof(int); a->used = *((const size_t *)buf), buf += sizeof(size_t); - a->alloced = 0; - if (a->sign) + if (a->sign) { ENSURE_SIZE(a, a->used); - else - a->chars = 0; - if (!zzero(a)) zmemcpy(a->chars, buf, a->used); + } return sizeof(int) + sizeof(size_t) + (zzero(a) ? 0 : a->used * sizeof(zahl_char_t)); } -- cgit v1.2.3-70-g09d2