From d6f4393542998276250bd3f3519bb824ca4b3d91 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 7 May 2016 17:22:42 +0200 Subject: Some small improvements 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, 4 insertions(+), 3 deletions(-) (limited to 'src/zload.c') diff --git a/src/zload.c b/src/zload.c index f788a45..2048332 100644 --- a/src/zload.c +++ b/src/zload.c @@ -6,11 +6,12 @@ size_t zload(z_t a, const void *buffer) { const char *buf = buffer; - a->sign = *((const long *)buf), buf += sizeof(long); - a->used = *((const size_t *)buf), buf += sizeof(size_t); + a->sign = (int)*((const long *)buf), buf += sizeof(long); + a->used = *((const size_t *)buf), buf += sizeof(size_t); if (likely(a->sign)) { ENSURE_SIZE(a, a->used); zmemcpy(a->chars, (const zahl_char_t *)buf, a->used); } - return sizeof(long) + sizeof(size_t) + (zzero(a) ? 0 : ((a->used + 3) & ~3) * sizeof(zahl_char_t)); + return sizeof(long) + sizeof(size_t) + + (zzero(a) ? 0 : ((a->used + 3) & (size_t)~3) * sizeof(zahl_char_t)); } -- cgit v1.2.3-70-g09d2