[U-Boot] [PATCH] tools: mkimage: fix sizeof_mismatch found by coverity

Sven Ebenfeld sven.ebenfeld at gmail.com
Tue Jan 17 19:36:51 CET 2017


Reported-by: Coverity (CID: 155214)
Signed-off-by: Sven Ebenfeld <sven.ebenfeld at gmail.com>
---
 tools/mkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index f48135f..e9d049e 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -522,7 +522,7 @@ int main(int argc, char **argv)
 							+ 0x20, 0 };
 			int i = params.file_size;
 			for (; i < aligned_filesize; i++) {
-				if (write(ifd, &i, 1) != 1) {
+				if (write(ifd, (char *) &i, 1) != 1) {
 					fprintf(stderr,
 							"%s: Write error on %s: %s\n",
 							params.cmdname,
-- 
2.7.4



More information about the U-Boot mailing list