mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-21 19:41:14 +00:00
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:
parent
1f6f0979bc
commit
a13e5cfbcf
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue