Explorar o código

do comparison instead of (bool) cast

Stefan Siegl %!s(int64=8) %!d(string=hai) anos
pai
achega
78807b6720
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      v8js.cc

+ 1 - 1
v8js.cc

@@ -77,7 +77,7 @@ static bool v8js_ini_to_bool(const zend_string *new_value) /* {{{ */
 	} else if (ZSTR_LEN(new_value) == 4 && strcasecmp("true", ZSTR_VAL(new_value)) == 0) {
 		return true;
 	} else {
-		return (bool) atoi(ZSTR_VAL(new_value));
+		return 0 != atoi(ZSTR_VAL(new_value));
 	}
 }
 /* }}} */