1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-21 12:40:04 +00:00

lsocket.c: Fixed arithmatic with void pointer

This commit is contained in:
CPunch 2022-03-14 12:13:31 -05:00
parent cb9823d21c
commit a8c1b44bb9

View File

@ -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);