diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
| commit | e1c678ef00f0159bbeb5571e5ebb0d4697121334 (patch) | |
| tree | 6547edef81a62a812a4d0f64e03fda226b5f0a7e /lib/wsprd | |
| parent | b9daa22c4c3ad51cd4bc0ef624a19f21d01c9305 (diff) | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
Update upstream source from tag 'upstream/3.0.0_rc1+repack'
Update to upstream version '3.0.0~rc1+repack'
with Debian dir 68c212e23136fecf9ebc6f12ff355579224d27ee
Diffstat (limited to 'lib/wsprd')
| -rwxr-xr-x | lib/wsprd/wsprd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index e0109da8..d269df64 100755 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -35,6 +35,7 @@ #include <stdint.h>
#include <time.h>
#include <fftw3.h>
+#include <errno.h>
#include "fano.h"
#include "jelinek.h"
@@ -77,7 +78,7 @@ unsigned long readc2file(char *ptr_to_infile, float *idat, float *qdat, fp = fopen(ptr_to_infile,"rb");
if (fp == NULL) {
- fprintf(stderr, "Cannot open data file '%s'\n", ptr_to_infile);
+ fprintf(stderr, "Cannot open data file '%s': %s\n", ptr_to_infile, strerror(errno));
return 1;
}
nr=fread(c2file,sizeof(char),14,fp);
@@ -146,6 +147,7 @@ unsigned long readwavfile(char *ptr_to_infile, int ntrmin, float *idat, float *q nr=fread(buf2,2,npoints,fp); //Read raw data
fclose(fp);
if( nr == 0 ) {
+ free(buf2);
fprintf(stderr, "No data in file '%s'\n", ptr_to_infile);
return 1;
}
@@ -1165,7 +1167,7 @@ int main(int argc, char *argv[]) for (k=0; k<162; k++) { //Sum over symbols
ifd=ifr+((float)k-81.0)/81.0*( (float)idrift )/(2.0*df);
kindex=k0+2*k;
- if( kindex < nffts ) {
+ if( kindex >= 0 && kindex < nffts ) {
p0=ps[ifd-3][kindex];
p1=ps[ifd-1][kindex];
p2=ps[ifd+1][kindex];
|
