sdr/pi4cxpsk: Rewrite loop logic in _gmr1_pi4cxpsk_freq_err for Coverity

Coverity seems confused because it doesn't see that this loop
is going to end exactly after 'n' iterations.

Fixes CID 1042965, CID 1042966

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2013-07-08 20:07:13 +02:00
parent 4b7a86cfbf
commit 4db4ba7826
1 changed files with 3 additions and 1 deletions

View File

@ -353,8 +353,10 @@ _gmr1_pi4cxpsk_freq_err(struct gmr1_pi4cxpsk_burst *burst_type,
float pos[n], f;
/* Correlate all 'chunks' */
for (i=0,csync=burst_type->sync[sync_id]; csync->pos>=0; i++,csync++)
for (i=0; i<n; i++)
{
csync = &burst_type->sync[sync_id][i];
corr[i] = 0.0f;
pos[i] = (float)csync->pos + (float)csync->len / 2.0f;