1
0
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:
dmiller
2016-05-23 04:30:06 +00:00
parent 5be0ac591b
commit 9450cb725a
5 changed files with 6 additions and 6 deletions

View File

@@ -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])