Fix stupid signed byte indexing.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5847 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-05-09 13:02:15 +00:00
parent 1f6f0979bc
commit a13e5cfbcf

View file

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