You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code of rx.c:rx_cmd_config the variable n is declared as unsigned int. However, n_samples is declared as size_t which in my machine is long unsigned int.
Hence, changing the code form:
if (!strcasecmp("n", argv[i])) {
/* Configure number of samples to receive */
unsigned int n;
bool ok;
n = str2uint_suffix(val, 0, UINT_MAX, rxtx_kmg_suffixes,
(int)rxtx_kmg_suffixes_len, &ok);
if (ok) {
MUTEX_LOCK(&s->rx->param_lock);
rx_params->n_samples = n;
MUTEX_UNLOCK(&s->rx->param_lock);
} else {
to:
if (!strcasecmp("n", argv[i])) {
/* Configure number of samples to receive */
uint64_t n;
bool ok;
n = str2uint64_suffix(val, 0, UINT64_MAX, rxtx_kmg_suffixes,
(int)rxtx_kmg_suffixes_len, &ok);
if (ok) {
MUTEX_LOCK(&s->rx->param_lock);
rx_params->n_samples = n;
MUTEX_UNLOCK(&s->rx->param_lock);
}
Fixes it on my machine but not in one where size_t is just unsigned int.
The text was updated successfully, but these errors were encountered:
Hello!
In bladeRF-cli, the
n
value inrx config
(probably in tx too) overflows at 2**32:In the code of rx.c:rx_cmd_config the variable
n
is declared asunsigned int
. However,n_samples
is declared assize_t
which in my machine islong unsigned int
.Hence, changing the code form:
to:
Fixes it on my machine but not in one where
size_t
is justunsigned int
.The text was updated successfully, but these errors were encountered: