From ee47da9c3992a846f3fb236e7796dbb88d44819c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Mar 2016 18:54:58 +0100 Subject: Avoid using the internal structure as much as possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/zload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zload.c') diff --git a/src/zload.c b/src/zload.c index 9e4521f..e03d911 100644 --- a/src/zload.c +++ b/src/zload.c @@ -17,8 +17,8 @@ zload(z_t a, const void *buffer) } else { a->chars = 0; } - if (a->sign) { + if (!zzero(a)) { memcpy(a->chars, buf, a->used * sizeof(*(a->chars))); } - return sizeof(z_t) - sizeof(a->chars) + (a->sign ? a->used * sizeof(*(a->chars)) : 0); + return sizeof(z_t) - sizeof(a->chars) + (zzero(a) ? 0 : a->used * sizeof(*(a->chars))); } -- cgit v1.2.3-70-g09d2