1
0
Fork 0
forked from len0rd/rockbox

Brian Foley fixed a flaw that made this code segfault on bigendian systems

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4273 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2004-01-26 07:51:35 +00:00
parent 61ba8bb6f5
commit a4c67dcab5

View file

@ -97,8 +97,11 @@ int main (int argc, char** argv)
int unpackedsize; int unpackedsize;
unsigned char xorstring[32]; unsigned char xorstring[32];
unpackedsize = ((unsigned int*)header)[1]; unpackedsize = header[4] | header[5] << 8;
length = ((unsigned int*)header)[2]; unpackedsize |= header[6] << 16 | header[7] << 24;
length = header[8] | header[9] << 8;
length |= header[10] << 16 | header[11] << 24;
/* calculate the xor string used */ /* calculate the xor string used */
for (i=0; i<stringlen; i++) { for (i=0; i<stringlen; i++) {