aboutsummaryrefslogtreecommitdiffstats
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/marshal.c b/marshal.c
index 8265c38..75a8749 100644
--- a/marshal.c
+++ b/marshal.c
@@ -47,11 +47,11 @@ libsha2_marshal(const struct libsha2_state *restrict state, char *restrict buf)
}
if (buf)
- memcpy(&buf[off], state->chunk, sizeof(state->chunk));
- off += sizeof(state->chunk);
- if (buf)
*(size_t *)&buf[off] = state->chunk_size;
off += sizeof(size_t);
+ if (buf)
+ memcpy(&buf[off], state->chunk, state->chunk_size);
+ off += state->chunk_size;
return off;
}