From b5e063d63ecd3dbed1b68b1ea6961137d4f3f153 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 May 2026 21:02:35 +0200 Subject: Fix mistakes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- hmac_marshal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hmac_marshal.c') diff --git a/hmac_marshal.c b/hmac_marshal.c index 1febed2..b6b1840 100644 --- a/hmac_marshal.c +++ b/hmac_marshal.c @@ -5,21 +5,21 @@ size_t libsha1_hmac_marshal(const struct libsha1_hmac_state *restrict state, void *restrict buf_) { - char *restrict buf = buf_; + unsigned char *restrict buf = buf_; size_t off = 0; if (buf) - *(int *)buf = 0; /* version */ + memcpy(buf, &(int){0}, sizeof(int)); /* version */ off += sizeof(int); off += libsha1_marshal(&state->sha1_state, buf ? &buf[off] : NULL); if (buf) - *(size_t *)&buf[off] = state->outsize; + memcpy(&buf[off], &state->outsize, sizeof(size_t)); off += sizeof(size_t); if (buf) - *(unsigned char *)&buf[off] = state->inited; + buf[off] = state->inited; off += sizeof(unsigned char); if (buf) -- cgit v1.3.1