From eb48479b37b28d8a82689a017771771beba78615 Mon Sep 17 00:00:00 2001
From: Navid Nikaein <navid.nikaein@eurecom.fr>
Date: Fri, 19 Feb 2016 15:12:41 +0100
Subject: [PATCH] check the rf_config_file name, and ignore if it is null

---
 targets/RT/USER/rrh_gw.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/targets/RT/USER/rrh_gw.c b/targets/RT/USER/rrh_gw.c
index 3def754e3d..8084644b85 100644
--- a/targets/RT/USER/rrh_gw.c
+++ b/targets/RT/USER/rrh_gw.c
@@ -299,11 +299,17 @@ static void get_options(int argc, char *argv[]) {
       loopback_flag=1; 
       break;
     case 'f':
-      if (strlen(optarg)<=1024)
-	strcpy(rf_config_file,optarg);
-      else {
-	printf("Configuration filename is too long\n");
-	exit(-1);   
+      if (optarg){
+	if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) {
+	  printf("no configuration filename is provided\n");
+	}
+	else if (strlen(optarg)<=1024){
+	  // rf_config_file = strdup(optarg);
+	  strcpy(rf_config_file,optarg);
+	}else {
+	  printf("Configuration filename is too long\n");
+	  exit(-1);   
+	}
       }
       break;
     case 't':
-- 
GitLab