summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-04-02 16:05:40 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-04-02 16:05:40 +0000
commit2c308a2f0c6126985ce791d55232c1995d6e2167 (patch)
tree3e3cca5c2afd0e284eb0bb42a442345714b50e9f /tools
parentc3391d0ad3b14e83143bdbc2e865d570b28e6cd1 (diff)
Make airlink.c more endianness robus (sn9)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6834 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools')
-rw-r--r--tools/firmware-utils/src/airlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/firmware-utils/src/airlink.c b/tools/firmware-utils/src/airlink.c
index 5a396f357..c24a9e320 100644
--- a/tools/firmware-utils/src/airlink.c
+++ b/tools/firmware-utils/src/airlink.c
@@ -245,7 +245,7 @@ int main(int argc, char **argv)
u32 sum, l0;
u32 MagicS = 0x474d544b;
u32 MagicE = 0x4152524e;
- if (htonl(*((u32 *) buf)) == MagicS) {
+ if (ntohl(*((u32 *) buf)) == MagicS) {
fprintf(stderr,
"Image without extra 8 bytes - Standard header\n");
buf[0x10] = len & 0xff;
@@ -255,8 +255,8 @@ int main(int argc, char **argv)
lseek(fd, 0x10, SEEK_SET);
write(fd, buf + 0x10, 0x4);
EHDR = 0;
- } else if ((htonl(*((u32 *) (buf + 0x8))) == MagicS)
- && ((htonl(*((u32 *) (buf + 0x4))) == MagicE))) {
+ } else if ((ntohl(*((u32 *) (buf + 0x8))) == MagicS)
+ && ((ntohl(*((u32 *) (buf + 0x4))) == MagicE))) {
fprintf(stderr,
"Image with extra 8 bytes - Extended header\n");
*((u32 *) (buf + 0x18)) = len - 8;