diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-09 21:30:06 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-09 21:30:06 +0100 |
commit | ae42e15f211feb8625450e5dcc899ae29d885ba7 (patch) | |
tree | bddb7469da7d1f32502df31e0d7c0d57aee66fde /marshal.c | |
parent | Improve makefile: mv LIBEXT and LIBFLAGS to config.mk (diff) | |
download | libsha2-ae42e15f211feb8625450e5dcc899ae29d885ba7.tar.gz libsha2-ae42e15f211feb8625450e5dcc899ae29d885ba7.tar.bz2 libsha2-ae42e15f211feb8625450e5dcc899ae29d885ba7.tar.xz |
Fix warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'marshal.c')
-rw-r--r-- | marshal.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -24,9 +24,7 @@ libsha2_marshal(const struct libsha2_state *restrict state, char *restrict buf) *(size_t *)&buf[off] = state->message_size; off += sizeof(size_t); - switch (state->algorithm) { - case LIBSHA2_224: - case LIBSHA2_256: + if (state->algorithm <= LIBSHA2_256) { if (buf) memcpy(&buf[off], state->k.b32, sizeof(state->k.b32)); off += sizeof(state->k.b32); @@ -36,9 +34,7 @@ libsha2_marshal(const struct libsha2_state *restrict state, char *restrict buf) if (buf) memcpy(&buf[off], state->h.b32, sizeof(state->h.b32)); off += sizeof(state->h.b32); - break; - - default: + } else { if (buf) memcpy(&buf[off], state->k.b64, sizeof(state->k.b64)); off += sizeof(state->k.b64); @@ -48,7 +44,6 @@ libsha2_marshal(const struct libsha2_state *restrict state, char *restrict buf) if (buf) memcpy(&buf[off], state->h.b64, sizeof(state->h.b64)); off += sizeof(state->h.b64); - break; } if (buf) |