[git commit] i2c_tools: suppress "'blen' may be used uninitialized in this function"

Denys Vlasenko vda.linux at googlemail.com
Sun Nov 1 19:58:03 UTC 2015


commit: http://git.busybox.net/busybox/commit/?id=2cf459141373d7ade0ba8cf5de83d4ef12b7dc97
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 miscutils/i2c_tools.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index e19d851..aa1c7c5 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -909,7 +909,7 @@ int i2cdump_main(int argc UNUSED_PARAM, char **argv)
 	unsigned first = 0x00, last = 0xff, opts;
 	int *block = (int *)bb_common_bufsiz1;
 	char *opt_r_str, *dash;
-	int fd, res, blen;
+	int fd, res;
 
         opt_complementary = "-2:?3"; /* from 2 to 3 args */
 	opts = getopt32(argv, optstr, &opt_r_str);
@@ -976,6 +976,8 @@ int i2cdump_main(int argc UNUSED_PARAM, char **argv)
 
 	/* All but word data. */
 	if (mode != I2C_SMBUS_WORD_DATA || even) {
+		int blen = 0;
+
 		if (mode == I2C_SMBUS_BLOCK_DATA || mode == I2C_SMBUS_I2C_BLOCK_DATA)
 			blen = read_block_data(fd, mode, block);
 


More information about the busybox-cvs mailing list