diff options
-rw-r--r-- | Android.mk | 3 | ||||
-rw-r--r-- | yaffs2/utils/mkyaffs2image.c | 11 |
2 files changed, 9 insertions, 5 deletions
@@ -6,9 +6,10 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ yaffs2/utils/mkyaffs2image.c \ yaffs2/yaffs_packedtags2.c \ + yaffs2/yaffs_ecc.c \ yaffs2/yaffs_tagsvalidity.c -LOCAL_CFLAGS = -O2 -Wall -DCONFIG_YAFFS_UTIL +LOCAL_CFLAGS = -O2 -Wall -DCONFIG_YAFFS_UTIL -DCONFIG_YAFFS_DOES_ECC LOCAL_CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations LOCAL_CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline diff --git a/yaffs2/utils/mkyaffs2image.c b/yaffs2/utils/mkyaffs2image.c index 53dc019..250cf11 100644 --- a/yaffs2/utils/mkyaffs2image.c +++ b/yaffs2/utils/mkyaffs2image.c @@ -211,8 +211,11 @@ static void little_to_big_endian(yaffs_PackedTags2 *pt) static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) { + char spare[spareSize]; yaffs_ExtendedTags t; - yaffs_PackedTags2 pt; + yaffs_PackedTags2 *pt = (yaffs_PackedTags2 *)spare; + + memset(spare, 0xff, spareSize); error = write(outFile,data,chunkSize); if(error < 0) return error; @@ -232,15 +235,15 @@ static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) nPages++; - yaffs_PackTags2(&pt,&t); + yaffs_PackTags2(pt,&t); if (convert_endian) { - little_to_big_endian(&pt); + little_to_big_endian(pt); } // return write(outFile,&pt,sizeof(yaffs_PackedTags2)); - return write(outFile,&pt,spareSize); + return write(outFile,spare, spareSize); } |