[tools] fix mktitanimg segfault on 64-bits hosts (#7443)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21767 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Florian Fainelli 2010-06-12 18:10:01 +00:00
parent 1981189666
commit 0be9ece4bc
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libgen.h>
#include "mktitanimg.h" #include "mktitanimg.h"
@ -55,7 +56,7 @@ void mknspimg_print_hdr(struct nsp_img_hdr *hdr)
printf("Offset Sect info: 0x%x\n", hdr->head.sect_info_offset); printf("Offset Sect info: 0x%x\n", hdr->head.sect_info_offset);
printf("Offset Sections: 0x%x\n", hdr->sect_info.sections_offset); printf("Offset Sections: 0x%x\n", hdr->sect_info.sections_offset);
chksum=(struct nsp_img_hdr_chksum *)((unsigned int)hdr+hdr->head.chksum_offset); chksum=(struct nsp_img_hdr_chksum *)(hdr+hdr->head.chksum_offset);
printf("Header Checksum: 0x%x\n", chksum->hdr_chksum); printf("Header Checksum: 0x%x\n", chksum->hdr_chksum);
printf("+++ Section Information +++\n"); printf("+++ Section Information +++\n");