summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-23 12:50:43 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-03-23 12:50:43 +0000
commit682110ad529927c7a9e73fe58930587fa2c033d8 (patch)
tree9dfb4b3bd01f0eb24378d0898bfdf380b4a5b2ba
parent6ca9d748753addbaca3ac4c1ac23a1ded347cf0b (diff)
Make mksyshdr safe for 64bits platforms (#1504)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6646 3c298f89-4303-0410-b956-a3cf2f4a3e73
-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 8f6604c6a0..a85cc793d4 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