From 6168264fd94d67ccff709a1fa7dc4e2d3951d863 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 20 Jan 2006 01:53:11 +0000 Subject: [PATCH] fix endianness issue with addpattern SVN-Revision: 3017 --- openwrt/target/utils/src/addpattern.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openwrt/target/utils/src/addpattern.c b/openwrt/target/utils/src/addpattern.c index ee5e63587c..2e0431a1d5 100644 --- a/openwrt/target/utils/src/addpattern.c +++ b/openwrt/target/utils/src/addpattern.c @@ -65,7 +65,8 @@ struct code_header { /* from cyutils.h */ char fwvern[3]; char id[4]; /* U2ND */ char hw_ver; /* 0: for 4702, 1: for 4712 -- new in 2.04.3 */ - unsigned short flags; /* SUPPORT_ flags new for 3.37.2 (WRT54G v2.2 and WRT54GS v1.1) */ + char unused; + unsigned char flags[2]; /* SUPPORT_ flags new for 3.37.2 (WRT54G v2.2 and WRT54GS v1.1) */ unsigned char res2[10]; } ; @@ -126,14 +127,14 @@ int main(int argc, char **argv) break; case '2': /* new 54G v2.2 and 54GS v1.1 flags */ hdr->hw_ver = 1; - hdr->flags |= SUPPORT_4712_CHIP; - hdr->flags |= SUPPORT_INTEL_FLASH; - hdr->flags |= SUPPORT_5325E_SWITCH; + hdr->flags[0] |= SUPPORT_4712_CHIP; + hdr->flags[0] |= SUPPORT_INTEL_FLASH; + hdr->flags[0] |= SUPPORT_5325E_SWITCH; break; case '4': /* V4 firmware sets the flags to 0x1f */ hdr->hw_ver = 0; - hdr->flags = 0x1f; + hdr->flags[0] = 0x1f; break; default: -- 2.30.2