aboutsummaryrefslogtreecommitdiffstats
path: root/src/zload.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/zload.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zload.c b/src/zload.c
index 877c95e..f788a45 100644
--- a/src/zload.c
+++ b/src/zload.c
@@ -6,11 +6,11 @@ size_t
zload(z_t a, const void *buffer)
{
const char *buf = buffer;
- a->sign = *((const int *)buf), buf += sizeof(int);
+ a->sign = *((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(int) + sizeof(size_t) + (zzero(a) ? 0 : a->used * sizeof(zahl_char_t));
+ return sizeof(long) + sizeof(size_t) + (zzero(a) ? 0 : ((a->used + 3) & ~3) * sizeof(zahl_char_t));
}