From a13e5cfbcf6e2b556bf5234c0de2b8755a41e594 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 9 May 2021 13:02:15 +0000 Subject: [PATCH] Fix stupid signed byte indexing. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5847 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/crc.c b/engine/common/crc.c index 8ed2e7f19..e30a52ef9 100644 --- a/engine/common/crc.c +++ b/engine/common/crc.c @@ -74,7 +74,7 @@ static void CRC16_Update (void *context, const void *data, size_t datasize) { unsigned short *ctx = context; unsigned short crc = *ctx; - const char *start = data; + const qbyte *start = data; while (datasize --> 0) crc = ((crc << 8) & 0xffff) ^ crctable[(crc >> 8) ^ *start++]; *ctx = crc; @@ -99,7 +99,7 @@ static void CRC16_Update_Lower (void *context, const void *data, size_t datasize { unsigned short *ctx = context; unsigned short crc = *ctx; - const char *start = data; + const qbyte *start = data; while (datasize --> 0) crc = ((crc << 8) & 0xffff) ^ crctable[(crc >> 8) ^ tolower(*start++)]; *ctx = crc;