diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-10 11:28:30 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-10 11:28:30 +0100 |
commit | d84edd9500e6e22ba49c76dc93a7c0731755d008 (patch) | |
tree | 5238a0362e0f70ea44fa40906c86102d5a50a4eb /marshal.c | |
parent | Fix warnings (diff) | |
download | libsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.gz libsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.bz2 libsha2-d84edd9500e6e22ba49c76dc93a7c0731755d008.tar.xz |
Fix libsha2_digest + minor improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
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; } |