check the rf_config_file name, and ignore if it is null
This commit is contained in:
@@ -299,11 +299,17 @@ static void get_options(int argc, char *argv[]) {
|
|||||||
loopback_flag=1;
|
loopback_flag=1;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
if (strlen(optarg)<=1024)
|
if (optarg){
|
||||||
strcpy(rf_config_file,optarg);
|
if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) {
|
||||||
else {
|
printf("no configuration filename is provided\n");
|
||||||
printf("Configuration filename is too long\n");
|
}
|
||||||
exit(-1);
|
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;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
|
|||||||
Reference in New Issue
Block a user