30 Aug
2017
30 Aug
'17
3:26 a.m.
From: Zhang Keqiao keqiaox.k.zhang@linux.intel.com
Fix a variable uninitialized issue, adding the initialized assignment to fix it.
Signed-off-by: Zhang Keqiao keqiaox.k.zhang@linux.intel.com --- bat/analyze.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bat/analyze.c b/bat/analyze.c index 2b8ca61..9808b73 100644 --- a/bat/analyze.c +++ b/bat/analyze.c @@ -34,7 +34,7 @@ static void check_amplitude(struct bat *bat, float *buf) int i, percent;
/* calculate average value */ - for (i = 0, sum = 0.0; i < bat->frames; i++) + for (i = 0, sum = 0.0, average = 0.0; i < bat->frames; i++) sum += buf[i]; average = sum / bat->frames;
--
2.9.3