From 555a652dfe40619fd316ff7016570734450daf44 Mon Sep 17 00:00:00 2001 From: Zhihao Cheng Date: Sun, 26 Jan 2025 14:41:59 +0800 Subject: misc-utils: flashcp: Fix uninitialized variable ‘wrlast_buf’ compiling warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compiler compains following message: misc-utils/flashcp.c:439:3: warning: ‘wrlast_buf’ may be used uninitialized in this function It won't bring any problems because variable '‘wrlast_buf’ is always initialized before being used. Fix the warning by setting 'wrlast_buf' as NULL when declaring it. Signed-off-by: Zhihao Cheng Signed-off-by: David Oberhollenzer --- misc-utils/flashcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc-utils/flashcp.c') diff --git a/misc-utils/flashcp.c b/misc-utils/flashcp.c index 9c48637..6065a8c 100644 --- a/misc-utils/flashcp.c +++ b/misc-utils/flashcp.c @@ -221,7 +221,7 @@ int main (int argc,char *argv[]) struct mtd_info_user mtd; struct erase_info_user erase; struct stat filestat; - unsigned char *src,*dest,*wrlast_buf; + unsigned char *src, *dest, *wrlast_buf = NULL; unsigned long long wrlast_len = 0; int error = 0; -- cgit v1.2.3