mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 13:19:04 +00:00
Avoid boolean tautologies of the form 'not x == y'
Lua operator 'not' has higher precedence than '==', so the statement
not x == "something"
is equivalent to:
(not x) == "something"
which will always be false, since the value of 'not x' will be either
'true' or 'false' and the string "something" is not the boolean 'true'
or 'false'. This is usually resolved by using the '~=' operator.
This commit is contained in:
@@ -86,7 +86,7 @@ Cisco = {
|
||||
local path = '/'
|
||||
local response = http.head(self.host, self.port, path, options)
|
||||
-- account for redirects
|
||||
if not response.status == 200 then
|
||||
if response.status ~= 200 then
|
||||
return false, "Failed to connect to SSL VPN server"
|
||||
elseif response.location then
|
||||
local u = url.parse(response.location[#response.location])
|
||||
|
||||
Reference in New Issue
Block a user