From 01897219565591cdf0d2f9f4e6de3aee24516378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 30 Oct 2023 18:54:45 +0100 Subject: [PATCH] (uxn.c) Fix pointer wrapping issues --- src/uxn.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uxn.c b/src/uxn.c index 4c2ca19..49ef3eb 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -17,12 +17,12 @@ WITH REGARD TO THIS SOFTWARE. [ L2 ][ N2 ][ T2 ] < */ -#define T *(s->dat + s->ptr - 1) -#define N *(s->dat + s->ptr - 2) -#define L *(s->dat + s->ptr - 3) -#define X *(s->dat + s->ptr - 4) -#define Y *(s->dat + s->ptr - 5) -#define Z *(s->dat + s->ptr - 6) +#define T *(s->dat + s->ptr) +#define N *(s->dat + (Uint8)(s->ptr - 1)) +#define L *(s->dat + (Uint8)(s->ptr - 2)) +#define X *(s->dat + (Uint8)(s->ptr - 3)) +#define Y *(s->dat + (Uint8)(s->ptr - 4)) +#define Z *(s->dat + (Uint8)(s->ptr - 5)) #define T2 (N << 8 | T) #define H2 (L << 8 | N) #define N2 (X << 8 | L)