diff --git a/projects/sdr_transceiver_wspr/app/transmit-wspr-message.c b/projects/sdr_transceiver_wspr/app/transmit-wspr-message.c index 72e4ebbc..c32a37a6 100644 --- a/projects/sdr_transceiver_wspr/app/transmit-wspr-message.c +++ b/projects/sdr_transceiver_wspr/app/transmit-wspr-message.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -19,13 +20,13 @@ int main(int argc, char *argv[]) volatile uint16_t *coef[2]; volatile uint32_t *fifo; unsigned char symbols[162]; - char *message, *hashtab; + char *message, *hashtab, *loctab; config_t config; double freq, corr, dphi, level; int chan; - hashtab = malloc(sizeof(char) * 32768 * 13); - memset(hashtab, 0, sizeof(char) * 32768 * 13); + hashtab = calloc(32768 * 13, sizeof(char)); + loctab = calloc(32768 * 5, sizeof(char)); if(argc != 2) { @@ -131,7 +132,7 @@ int main(int argc, char *argv[]) *rst &= ~1; *rst |= 1; - get_wspr_channel_symbols(message, hashtab, symbols); + get_wspr_channel_symbols(message, hashtab, loctab, symbols); for(i = 0; i < 162; ++i) { diff --git a/projects/sdr_transceiver_wspr_122_88/app/transmit-wspr-message.c b/projects/sdr_transceiver_wspr_122_88/app/transmit-wspr-message.c index cc06dcfd..2c12675a 100644 --- a/projects/sdr_transceiver_wspr_122_88/app/transmit-wspr-message.c +++ b/projects/sdr_transceiver_wspr_122_88/app/transmit-wspr-message.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -19,13 +20,13 @@ int main(int argc, char *argv[]) volatile uint16_t *coef[2]; volatile uint32_t *fifo; unsigned char symbols[162]; - char *message, *hashtab; + char *message, *hashtab, *loctab; config_t config; double freq, corr, dphi, level; int chan; - hashtab = malloc(sizeof(char) * 32768 * 13); - memset(hashtab, 0, sizeof(char) * 32768 * 13); + hashtab = calloc(32768 * 13, sizeof(char)); + loctab = calloc(32768 * 5, sizeof(char)); if(argc != 2) { @@ -131,7 +132,7 @@ int main(int argc, char *argv[]) *rst &= ~1; *rst |= 1; - get_wspr_channel_symbols(message, hashtab, symbols); + get_wspr_channel_symbols(message, hashtab, loctab, symbols); for(i = 0; i < 162; ++i) {