diff options
author | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:06:26 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:06:26 +0200 |
commit | a198f806d60b641406955d6b8c494b2bd5d8989c (patch) | |
tree | 27883711145184fff8d9dc564d368383b1c675db /libkeccak_state_marshal.c | |
parent | Fix warning (diff) | |
download | libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.gz libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.bz2 libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.xz |
Do not divide by sizeof(char)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libkeccak_state_marshal.c')
-rw-r--r-- | libkeccak_state_marshal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libkeccak_state_marshal.c b/libkeccak_state_marshal.c index c4ce7f6..896676d 100644 --- a/libkeccak_state_marshal.c +++ b/libkeccak_state_marshal.c @@ -12,7 +12,7 @@ size_t libkeccak_state_marshal(const struct libkeccak_state *restrict state, void *restrict data_) { -#define set(type, var) *((type *)data) = state->var, data += sizeof(type) / sizeof(char) +#define set(type, var) *((type *)data) = state->var, data += sizeof(type) unsigned char *restrict data = data_; if (data) { set(long int, r); @@ -24,7 +24,7 @@ libkeccak_state_marshal(const struct libkeccak_state *restrict state, void *rest set(long int, l); set(long int, nr); memcpy(data, state->S, sizeof(state->S)); - data += sizeof(state->S) / sizeof(char); + data += sizeof(state->S); set(size_t, mptr); set(size_t, mlen); memcpy(data, state->M, state->mptr * sizeof(char)); |