ZMQ: return error if no arguments provided

This commit is contained in:
Xavier Arteaga 2019-11-26 14:20:21 +01:00 committed by Xavier Arteaga
parent ff77bcb782
commit ff2c0cd115
1 changed files with 5 additions and 2 deletions

View File

@ -215,7 +215,7 @@ int rf_zmq_open_multi(char* args, void** h, uint32_t nof_channels)
strcpy(handler->id, "zmq\0");
// parse args
if (args) {
if (args && strlen(args)) {
// base_srate
{
const char config_arg[] = "base_srate=";
@ -244,6 +244,9 @@ int rf_zmq_open_multi(char* args, void** h, uint32_t nof_channels)
remove_substring(args, config_str);
}
}
} else {
fprintf(stderr, "[zmq] Error: RF device args are required for ZMQ no-RF module\n");
goto clean_exit;
}
update_rates(handler, 1.92e6);
@ -255,7 +258,7 @@ int rf_zmq_open_multi(char* args, void** h, uint32_t nof_channels)
goto clean_exit;
}
for (int i = 0; i < handler->nof_channels && args != NULL; i++) {
for (int i = 0; i < handler->nof_channels; i++) {
// rxport
{
char config_arg[PARAM_LEN] = "rx_port=";