summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-01-28 10:28:34 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-01-28 10:28:34 +0000
commitddd1551d3e129e7e27b3dc3bbfe800f4491ba318 (patch)
tree75af30daaaef033a637f402fad198545be5c5115 /tools
parentc47fadb11243cbf1e78515d024265b9b53645502 (diff)
downloadrockbox-ddd1551d3e129e7e27b3dc3bbfe800f4491ba318.zip
rockbox-ddd1551d3e129e7e27b3dc3bbfe800f4491ba318.tar.gz
rockbox-ddd1551d3e129e7e27b3dc3bbfe800f4491ba318.tar.bz2
rockbox-ddd1551d3e129e7e27b3dc3bbfe800f4491ba318.tar.xz
The checksum is not a CRC
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5686 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/scramble.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index d94dabf..22d9513 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -61,7 +61,7 @@ int main (int argc, char** argv)
unsigned long length,i,slen;
unsigned char *inbuf,*outbuf;
unsigned short crc=0;
- unsigned long crc32=0; /* 32 bit checksum */
+ unsigned long chksum=0; /* 32 bit checksum */
unsigned char header[24];
unsigned char *iname = argv[1];
unsigned char *oname = argv[2];
@@ -143,7 +143,7 @@ int main (int argc, char** argv)
}
/* we store a 4-letter model name too, for humans */
strcpy(irivermodel, &argv[1][5]);
- crc32 = irivernum; /* start checksum calcs with this */
+ chksum = irivernum; /* start checksum calcs with this */
}
else if(!strcmp(argv[1], "-iriver")) {
@@ -202,7 +202,7 @@ int main (int argc, char** argv)
for (i = 0; i < length/2; i++) {
unsigned short *inbuf16 = (unsigned short *)inbuf;
/* add 16 unsigned bits but keep a 32 bit sum */
- crc32 += inbuf16[i];
+ chksum += inbuf16[i];
}
break;
case scramble:
@@ -237,7 +237,7 @@ int main (int argc, char** argv)
{
case add:
{
- int2be(crc32, header); /* checksum, big-endian */
+ int2be(chksum, header); /* checksum, big-endian */
memcpy(&header[4], irivermodel, 4); /* 4 bytes model name */
memcpy(outbuf, inbuf, length); /* the input buffer to output*/
headerlen = 8;