if (local_argv[x] && !strcmp(local_argv[x], "-service")) {
/* New installs will always have the service name specified, but keep a default for compat */
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
switch_copy_string(service_name, local_argv[x], SERVICENAME_MAXLEN);
} else {
switch_copy_string(service_name, SERVICENAME_DEFAULT, SERVICENAME_MAXLEN);
char exePath[1024];
char servicePath[1024];
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
switch_copy_string(service_name, local_argv[x], SERVICENAME_MAXLEN);
} else {
switch_copy_string(service_name, SERVICENAME_DEFAULT, SERVICENAME_MAXLEN);
if (local_argv[x] && !strcmp(local_argv[x], "-uninstall")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
switch_copy_string(service_name, local_argv[x], SERVICENAME_MAXLEN);
} else {
switch_copy_string(service_name, SERVICENAME_DEFAULT, SERVICENAME_MAXLEN);
#else
if (local_argv[x] && !strcmp(local_argv[x], "-u")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
runas_user = local_argv[x];
}
known_opt++;
if (local_argv[x] && !strcmp(local_argv[x], "-g")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
runas_group = local_argv[x];
}
known_opt++;
if (local_argv[x] && !strcmp(local_argv[x], "-conf")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.conf_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.conf_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-mod")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.mod_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.mod_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-log")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.log_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.log_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-run")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.run_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.run_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-db")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.db_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.db_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-scripts")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.script_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.script_dir) {
fprintf(stderr, "Allocation error\n");
if (local_argv[x] && !strcmp(local_argv[x], "-htdocs")) {
x++;
- if (local_argv[x] && strlen(local_argv[x])) {
+ if (!switch_strlen_zero(local_argv[x])) {
SWITCH_GLOBAL_dirs.htdocs_dir = (char *) malloc(strlen(local_argv[x]) + 1);
if (!SWITCH_GLOBAL_dirs.htdocs_dir) {
fprintf(stderr, "Allocation error\n");