From: Ɓukasz Majewski Date: Fri, 21 Nov 2014 08:22:43 +0000 (+0100) Subject: fix: tools: kwbimage.c: Initialize headersz to suppress warning X-Git-Tag: v2015.01~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=93e9371f00f1efa9fc570f8e7e8889eae7639868;p=u-boot fix: tools: kwbimage.c: Initialize headersz to suppress warning When building with my toolchain (4.8.2): CROSS_COMPILE=/home/lukma/work/ptxdist/toolchains/arm/OSELAS.Toolchain-2013.12.0/arm-v7a-linux-gnueabi/gcc-4.8.2-glibc-2.18-binutils-2.24-kernel-3.12-sanitized/bin/arm-v7a-linux-gnueabi- I see following WARNING: tools/kwbimage.c: In function "kwbimage_set_header": tools/kwbimage.c:803:8: warning: "headersz" may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy(ptr, image, headersz); ^ This fix aims to suppress it. Signed-off-by: Lukasz Majewski Acked-by: Stefan Roese Acked-by: Heiko Schocher --- diff --git a/tools/kwbimage.c b/tools/kwbimage.c index c50f2e2b24..2c302e5d49 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -728,7 +728,7 @@ static void kwbimage_set_header(void *ptr, struct stat *sbuf, int ifd, FILE *fcfg; void *image = NULL; int version; - size_t headersz; + size_t headersz = 0; uint32_t checksum; int ret; int size;