projects
/
openwrt
/
staging
/
adrian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a82c2c
)
firmware-utils/mkdir615h1: fix magic XOR calculation
author
John Crispin
<john@openwrt.org>
Tue, 24 Jun 2014 18:13:00 +0000
(18:13 +0000)
committer
John Crispin
<john@openwrt.org>
Tue, 24 Jun 2014 18:13:00 +0000
(18:13 +0000)
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
SVN-Revision: 41314
tools/firmware-utils/src/mkdir615h1.c
patch
|
blob
|
history
diff --git
a/tools/firmware-utils/src/mkdir615h1.c
b/tools/firmware-utils/src/mkdir615h1.c
index 84692aa3aa4d4ba23d23e13d9fd52d0cc38aed6b..d9fb35c1ecbb363295049ba5206fb2f9b3b2a328 100644
(file)
--- a/
tools/firmware-utils/src/mkdir615h1.c
+++ b/
tools/firmware-utils/src/mkdir615h1.c
@@
-199,7
+199,7
@@
static int encode_image(const char *input_file_name,
}
for (i = 0; i < bytes_read; i++)
- buf[i] ^= magic >> (
(((i >> 60) + i) & 7) - (i >> 60))
;
+ buf[i] ^= magic >> (
i % 8) & 0xff
;
fwrite(&buf, bytes_read, 1, fp_output);
}
@@
-254,7
+254,7
@@
int decode_image(const char *input_file_name, const char *output_file_name)
bytes_read = fread(&buf, 1, BUF_SIZE, fp_input);
for (i = 0; i < bytes_read; i++)
- buf[i] ^= header.magic >> (
(((i >> 60) + i) & 7) - (i >> 60))
;
+ buf[i] ^= header.magic >> (
i % 8) & 0xff
;
/*
* Handle padded source file