aboutsummaryrefslogtreecommitdiffstats
path: root/unmarshal.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-09 21:30:06 +0100
committerMattias Andrée <maandree@kth.se>2019-02-09 21:30:06 +0100
commitae42e15f211feb8625450e5dcc899ae29d885ba7 (patch)
treebddb7469da7d1f32502df31e0d7c0d57aee66fde /unmarshal.c
parentImprove makefile: mv LIBEXT and LIBFLAGS to config.mk (diff)
downloadlibsha2-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 'unmarshal.c')
-rw-r--r--unmarshal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unmarshal.c b/unmarshal.c
index 2a47b92..13a97ff 100644
--- a/unmarshal.c
+++ b/unmarshal.c
@@ -20,15 +20,15 @@ libsha2_unmarshal(struct libsha2_state *restrict state, const char *restrict buf
return 0;
}
- if (*(int *)buf) { /* version */
+ if (*(const int *)buf) { /* version */
errno = EINVAL;
return 0;
}
off += sizeof(int);
- state->algorithm = *(enum libsha2_algorithm *)&buf[off];
+ state->algorithm = *(const enum libsha2_algorithm *)&buf[off];
off += sizeof(enum libsha2_algorithm);
- state->message_size = *(size_t *)&buf[off];
+ state->message_size = *(const size_t *)&buf[off];
off += sizeof(size_t);
switch (state->algorithm) {
@@ -73,7 +73,7 @@ libsha2_unmarshal(struct libsha2_state *restrict state, const char *restrict buf
}
memcpy(state->chunk, &buf[off], sizeof(state->chunk));
off += sizeof(state->chunk);
- state->chunk_size = *(size_t *)&buf[off];
+ state->chunk_size = *(const size_t *)&buf[off];
off += sizeof(size_t);
return off;