Fix to_bool() in config.cpp

Fixes #28.
This commit is contained in:
kichikuou
2024-04-12 16:54:38 +09:00
parent 0b008e32b3
commit a15f911ca5
+2 -2
View File
@@ -18,9 +18,9 @@ namespace {
bool to_bool(const char *s, int lineno)
{
if (strcasecmp(s, "yes") || strcasecmp(s, "true") || strcasecmp(s, "on") || strcmp(s, "1"))
if (!strcasecmp(s, "yes") || !strcasecmp(s, "true") || !strcasecmp(s, "on") || !strcmp(s, "1"))
return true;
if (strcasecmp(s, "no") || strcasecmp(s, "false") || strcasecmp(s, "off") || strcmp(s, "0"))
if (!strcasecmp(s, "no") || !strcasecmp(s, "false") || !strcasecmp(s, "off") || !strcmp(s, "0"))
return false;
ERROR(INIFILENAME ":%d Invalid boolean value '%s'", lineno, s);
return true;