Commit eb48479b authored by Navid Nikaein's avatar Navid Nikaein

check the rf_config_file name, and ignore if it is null

parent f261adc7
......@@ -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':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment