mirror of
https://github.com/vivier/EMILE.git
synced 2025-03-11 08:32:45 +00:00
length is 16bit value
This commit is contained in:
parent
b5058db8ef
commit
75f78cecb6
@ -1,17 +1,19 @@
|
||||
static __attribute__((used)) char* rcsid = "$CVSHeader$";
|
||||
/*
|
||||
*
|
||||
* (c) 2004 Laurent Vivier <Laurent@lvivier.info>
|
||||
* (c) 2004-2008 Laurent Vivier <Laurent@lvivier.info>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "libemile.h"
|
||||
#include <stdio.h>
|
||||
|
||||
unsigned short emile_checksum(unsigned char *addr, unsigned int length)
|
||||
{
|
||||
int j;
|
||||
unsigned short sum = 0;
|
||||
|
||||
length &= 0xFFFF;
|
||||
|
||||
for (j = 0; j < length; j++)
|
||||
{
|
||||
sum += addr[j];
|
||||
|
Loading…
x
Reference in New Issue
Block a user