From a8c1b44bb9a46bd76eda13603b04f652bdb3182a Mon Sep 17 00:00:00 2001 From: CPunch Date: Mon, 14 Mar 2022 12:13:31 -0500 Subject: [PATCH] lsocket.c: Fixed arithmatic with void pointer --- lib/src/lsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/lsocket.c b/lib/src/lsocket.c index 84c236b..3aedb48 100644 --- a/lib/src/lsocket.c +++ b/lib/src/lsocket.c @@ -246,7 +246,7 @@ void laikaS_readInt(struct sLaika_socket *sock, void *buf, size_t sz) { /* copy tmp buffer to user buffer, flipping endianness */ for (k = 0; k < sz; k++) - *(uint8_t*)(buf + k) = tmp[sz - k - 1]; + *((uint8_t*)buf + k) = tmp[sz - k - 1]; ENDVLA(tmp); } else { @@ -262,7 +262,7 @@ void laikaS_writeInt(struct sLaika_socket *sock, void *buf, size_t sz) { /* copy user buffer to tmp buffer, flipping endianness */ for (k = 0; k < sz; k++) - tmp[k] = *(uint8_t*)(buf + (sz - k - 1)); + tmp[k] = *((uint8_t*)buf + (sz - k - 1)); laikaS_write(sock, (void*)tmp, sz); ENDVLA(tmp);