aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-03-23 12:50:43 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-03-23 12:50:43 +0000
commiteaf0c708f2c23265ce9f95d38d3bb1d942d68e3f (patch)
tree8d27bca3b04e042ddc02b6d1604cc59b49a3fc94 /tools/firmware-utils
parentf63dd06ad7c7f13dd0372a5886235c8f04366ad2 (diff)
downloadupstream-eaf0c708f2c23265ce9f95d38d3bb1d942d68e3f.tar.gz
upstream-eaf0c708f2c23265ce9f95d38d3bb1d942d68e3f.tar.bz2
upstream-eaf0c708f2c23265ce9f95d38d3bb1d942d68e3f.zip
Make mksyshdr safe for 64bits platforms (#1504)
SVN-Revision: 6646
Diffstat (limited to 'tools/firmware-utils')
-rw-r--r--tools/firmware-utils/src/mksyshdr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/firmware-utils/src/mksyshdr.c b/tools/firmware-utils/src/mksyshdr.c
index 9c6888e773..9c1cd14336 100644
--- a/tools/firmware-utils/src/mksyshdr.c
+++ b/tools/firmware-utils/src/mksyshdr.c
@@ -1,11 +1,13 @@
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
+
int main(int argc, char* argv[])
{
FILE* fp;
- long nImgSize;
+ uint32_t nImgSize;
char* pHeader1 = "CSYS";
- long nHeader2 = 0x80500000;
+ uint32_t nHeader2 = 0x80500000;
if (argc != 3)
{
@@ -23,8 +25,8 @@ int main(int argc, char* argv[])
if (fp != NULL)
{
fwrite(pHeader1, sizeof(char), 4, fp);
- fwrite(&nHeader2, sizeof(long), 1, fp);
- fwrite(&nImgSize, sizeof(long), 1, fp);
+ fwrite(&nHeader2, sizeof(nHeader2), 1, fp);
+ fwrite(&nImgSize, sizeof(nImgSize), 1, fp);
fclose(fp);
}
else