From 96a60f51b02fc4ff8eb486fd4e0e763ec8f76bdb Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Mon, 21 Mar 2016 17:28:46 +0000 Subject: [PATCH] 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 --- src/fsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsk.c b/src/fsk.c index 2060e07..394ce2c 100644 --- a/src/fsk.c +++ b/src/fsk.c @@ -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,