Browse Source

tools: imx image: fix write warning

Fix the warning by set the variable zero to uint64_t
"warning: ‘write’ reading 5 bytes from a region of size 4"

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Peng Fan 3 years ago
parent
commit
16841a6a50
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tools/imx8image.c
  2. 1 1
      tools/imx8mimage.c

+ 1 - 1
tools/imx8image.c

@@ -365,7 +365,7 @@ static void copy_file (int ifd, const char *datafile, int pad, int offset)
 	struct stat sbuf;
 	unsigned char *ptr;
 	int tail;
-	int zero = 0;
+	uint64_t zero = 0;
 	uint8_t zeros[4096];
 	int size, ret;
 

+ 1 - 1
tools/imx8mimage.c

@@ -248,7 +248,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
 	struct stat sbuf;
 	unsigned char *ptr;
 	int tail;
-	int zero = 0;
+	uint64_t zero = 0;
 	uint8_t zeros[4096];
 	int size, ret;