summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-01-28 12:20:20 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-01-28 12:20:20 +0000
commit599b0ff0b1b0f59261e97de123520d1aa91250be (patch)
tree3f90530312769853fc55e8ad5bfe5c1e568bef40
parentddd1551d3e129e7e27b3dc3bbfe800f4491ba318 (diff)
Made the -add option use char instead of short, prevents endianness problems
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5687 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--tools/scramble.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index 22d9513d4a..3be92d0605 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -199,10 +199,9 @@ int main (int argc, char** argv)
switch (method)
{
case add:
- for (i = 0; i < length/2; i++) {
- unsigned short *inbuf16 = (unsigned short *)inbuf;
- /* add 16 unsigned bits but keep a 32 bit sum */
- chksum += inbuf16[i];
+ for (i = 0; i < length; i++) {
+ /* add 8 unsigned bits but keep a 32 bit sum */
+ chksum += inbuf[i];
}
break;
case scramble: