aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2025-01-26 14:41:59 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2025-01-30 18:30:16 +0100
commit555a652dfe40619fd316ff7016570734450daf44 (patch)
tree15d8ab19387d287065ac2ae2aacca0a4a1951061
parent9d755ba03f6947ed0f77df8a2bcdb1b6585dabf9 (diff)
misc-utils: flashcp: Fix uninitialized variable ‘wrlast_buf’ compiling warning
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 <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--misc-utils/flashcp.c2
1 files changed, 1 insertions, 1 deletions
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;