diff --git a/usr.sbin/i2c/i2c.c b/usr.sbin/i2c/i2c.c index 3021b868e181..744fefc7121f 100644 --- a/usr.sbin/i2c/i2c.c +++ b/usr.sbin/i2c/i2c.c @@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf) err_msg = "error: offset malloc"; goto err1; } - } + } else + bufsize = 0; switch(i2c_opt.mode) { case I2C_MODE_STOP_START: