initialize ampl_out to avoid it containing garbage

static analysis from clang scan-build detected some paths
in the call to fsk_frame_analyze where ampl_out is not being
set:

fsk.c:493:13: warning: Assigned value is garbage or undefined
            best_a = ampl_out;

..probably the sanest approach here is to initialize it to 0.0
just to avoid it being garbage rather than setting it to zero in
the failed error paths in fsk_frame_analyze.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
This commit is contained in:
Colin Ian King 2016-03-21 17:28:46 +00:00 committed by Kamal Mostafa
parent 2d3bd487ca
commit 96a60f51b0
1 changed files with 1 additions and 1 deletions

View File

@ -481,7 +481,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
if ( t < 0 )
continue;
float c, ampl_out;
float c, ampl_out = 0.0;
unsigned long long bits_out = 0;
debug_log("try fsk_frame_analyze at t=%d\n", t);
c = fsk_frame_analyze(fskp, samples+t, samples_per_bit,