Skip to content

Commit

Permalink
bladeRF-fsk: correct calloc argument order in fir filter test
Browse files Browse the repository at this point in the history
Prevents compiler error
- earlier calloc argument should specify number of elements, later size
  of each element
- failed in Fedora Linux 40 with gcc version 14.0.1 20240411 (Red Hat
  14.0.1-0) (GCC)

closes #965
  • Loading branch information
meriac authored and rthomp10 committed Aug 14, 2024
1 parent 3db52ac commit b55af91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions host/utilities/bladeRF-fsk/c/src/fir_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}

inbuf = calloc(2*sizeof(int16_t), chunk_size);
inbuf = calloc(chunk_size, 2*sizeof(int16_t));
if (!inbuf) {
perror("calloc");
goto out;
}
tempbuf = calloc(2*sizeof(int16_t), chunk_size);
tempbuf = calloc(chunk_size, 2*sizeof(int16_t));
if (!tempbuf) {
perror("calloc");
goto out;
}

outbuf = calloc(sizeof(struct complex_sample), chunk_size);
outbuf = calloc(chunk_size, sizeof(struct complex_sample));
if (!outbuf) {
perror("calloc");
goto out;
Expand Down

0 comments on commit b55af91

Please sign in to comment.