Skip to content

Commit 786d70f

Browse files
author
Steve
authored
Update fsk_get_test_bits.c
Change from alloca() to malloc() for msys compatibility
1 parent a801aed commit 786d70f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/fsk_get_test_bits.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#include <stdio.h>
3131
#include <stdlib.h>
32-
#include <alloca.h>
3332
#include <string.h>
3433
#include "fsk.h"
3534

@@ -70,11 +69,11 @@ int main(int argc,char *argv[]){
7069

7170
if(fout==NULL){
7271
fprintf(stderr,"Couldn't open output file: %s\n", argv[1]);
73-
goto cleanup;
72+
exit(1);
7473
}
7574

7675
/* allocate buffers for processing */
77-
bitbuf = (uint8_t*)alloca(sizeof(uint8_t)*framesize);
76+
bitbuf = (uint8_t*)malloc(sizeof(uint8_t)*framesize);
7877

7978
/* Generate buffer of test frame bits from known seed */
8079
srand(158324);
@@ -91,7 +90,7 @@ int main(int argc,char *argv[]){
9190
}
9291
}
9392

94-
cleanup:
93+
free(bitbuf);
9594
fclose(fout);
9695

9796
return 0;

0 commit comments

Comments
 (0)