Make mksyshdr safe for 64bits platforms (#1504)
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 23 Mar 2007 12:50:43 +0000 (12:50 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 23 Mar 2007 12:50:43 +0000 (12:50 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6646 3c298f89-4303-0410-b956-a3cf2f4a3e73

tools/firmware-utils/src/mksyshdr.c

index 8f6604c..a85cc79 100644 (file)
@@ -1,11 +1,13 @@
 #include <stdlib.h>\r
 #include <stdio.h>\r
+#include <stdint.h>\r
+\r
 int main(int argc, char* argv[])\r
 {\r
        FILE* fp;\r
-       long  nImgSize;\r
+       uint32_t  nImgSize;\r
        char* pHeader1 = "CSYS";\r
-       long  nHeader2 = 0x80500000;\r
+       uint32_t  nHeader2 = 0x80500000;\r
 \r
        if (argc != 3)\r
        {\r
@@ -23,8 +25,8 @@ int main(int argc, char* argv[])
                if (fp != NULL)\r
                {\r
                        fwrite(pHeader1,  sizeof(char), 4, fp);\r
-                       fwrite(&nHeader2, sizeof(long), 1, fp);\r
-                       fwrite(&nImgSize, sizeof(long), 1, fp);\r
+                       fwrite(&nHeader2, sizeof(nHeader2), 1, fp);\r
+                       fwrite(&nImgSize, sizeof(nImgSize), 1, fp);\r
                        fclose(fp);\r
                }\r
                else\r
This page took 0.027504 seconds and 4 git commands to generate.