diff options
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |