Added a warning for bad boolean configuration values.

This commit is contained in:
Markus Makela
2015-05-04 20:26:32 +03:00
parent 97c96b1141
commit c2c318a95d

View File

@ -2049,15 +2049,18 @@ bool config_set_qualified_param(
int int
config_truth_value(char *str) config_truth_value(char *str)
{ {
if (strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0 || strcasecmp(str, "yes") == 0) if (strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0 ||
strcasecmp(str, "yes") == 0 || strcasecmp(str, "1") == 0)
{ {
return 1; return 1;
} }
if (strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0 || strcasecmp(str, "no") == 0) if (strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0 ||
strcasecmp(str, "no") == 0|| strcasecmp(str, "0") == 0)
{ {
return 0; return 0;
} }
return atoi(str); skygw_log_write(LOGFILE_ERROR,"Error: Not a boolean value: %s",str);
return -1;
} }