aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-04-25 12:32:39 -0700
committerMartin Braun <martin.braun@ettus.com>2017-04-25 17:15:13 -0700
commita96fdcfe275451c2a217c6ccf34cdd73c5719905 (patch)
tree897aaf99be3a17e4ec41a93bdabbbd4389bbefa7
parentd2a354bbe4b8ecd81f5c3bdb459a9ae822f91e9a (diff)
downloaduhd-a96fdcfe275451c2a217c6ccf34cdd73c5719905.tar.gz
uhd-a96fdcfe275451c2a217c6ccf34cdd73c5719905.tar.bz2
uhd-a96fdcfe275451c2a217c6ccf34cdd73c5719905.zip
examples: fix device_args parsing in tx_samples_c
-rw-r--r--host/examples/tx_samples_c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/host/examples/tx_samples_c.c b/host/examples/tx_samples_c.c
index f04d4b26c..333c7e820 100644
--- a/host/examples/tx_samples_c.c
+++ b/host/examples/tx_samples_c.c
@@ -57,7 +57,7 @@ int main(int argc, char* argv[]){
double freq = 2e9;
double rate = 1e6;
double gain = 0;
- char* device_args = "";
+ char* device_args;
size_t channel = 0;
uint64_t total_num_samps = 0;
bool verbose = false;
@@ -106,6 +106,9 @@ int main(int argc, char* argv[]){
fprintf(stderr, "Unable to set thread priority. Continuing anyway.\n");
}
+ if (device_args == NULL){
+ device_args = "";
+ }
// Create USRP
uhd_usrp_handle usrp;
fprintf(stderr, "Creating USRP with args \"%s\"...\n", device_args);
@@ -246,7 +249,7 @@ int main(int argc, char* argv[]){
uhd_usrp_free(&usrp);
free_option_strings:
- if(strcmp(device_args,"")){
+ if(device_args != NULL){
free(device_args);
}