From: DeaDDooMER Date: Wed, 11 Mar 2020 15:54:08 +0000 (+0300) Subject: fix segfault on 64 bit X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=2a4083d2b1d0efed86339e7f73b7142c255574a8;p=flatwaifu.git fix segfault on 64 bit --- diff --git a/src/memory.c b/src/memory.c index af93fa6..d3c5e8c 100644 --- a/src/memory.c +++ b/src/memory.c @@ -92,11 +92,9 @@ void M_unlock(void *p) { } int M_locked (int h) { - h&=-1-0x8000; - return (h != -1) && (h != 0xFFFF) && (resl[h] != 0); + return (h != -1) && (h != 0xFFFF) && (resl[h & (-1 - 0x8000)] != 0); } int M_was_locked (int h) { - h&=-1-0x8000; - return (h != -1) && (h != 0xFFFF) && (resp[h] != NULL); + return (h != -1) && (h != 0xFFFF) && (resp[h & (-1 - 0x8000)] != NULL); }