From 73825e66f1efe20666d5b51dc3f9adb26964a090 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sun, 2 Aug 2015 23:18:51 +0000 Subject: [PATCH] Make fano.c decode 31 tail zeros instead of just 30. This decreases the probability of bad decodes somewhat. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5746 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/wsprd/fano.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wsprd/fano.c b/lib/wsprd/fano.c index 4ae659a93..2e960221c 100644 --- a/lib/wsprd/fano.c +++ b/lib/wsprd/fano.c @@ -105,7 +105,7 @@ int fano( unsigned int lsym; unsigned int i; - if((nodes = (struct node *)malloc(nbits*sizeof(struct node))) == NULL) { + if((nodes = (struct node *)malloc((nbits+1)*sizeof(struct node))) == NULL) { printf("malloc failed\n"); return 0; } @@ -172,7 +172,7 @@ int fano( } np[1].gamma = ngamma; // Move forward np[1].encstate = np->encstate << 1; - if(++np == lastnode) { + if( ++np == (lastnode+1) ) { break; // Done! }