remove more instances of positive?
parent
6f97e45b35
commit
24d323d4ed
|
@ -33,7 +33,7 @@ module UDS
|
|||
end
|
||||
left2combine = hash["Packets"].size
|
||||
counter = 0
|
||||
while left2combine.positive? && (bad_count < (hash["Packets"].size * 2))
|
||||
while left2combine > 0 && (bad_count < (hash["Packets"].size * 2))
|
||||
# print_line("DEBUG Current status combine=#{left2combine} data=#{data.inspect}")
|
||||
hash["Packets"].each do |pkt|
|
||||
if (pkt.key? "ID") && pkt["ID"].hex == id.hex
|
||||
|
|
|
@ -269,7 +269,7 @@ class Console::CommandDispatcher::Automotive
|
|||
return
|
||||
end
|
||||
if id.blank? && !stop
|
||||
if self.tpjobs.size.positive?
|
||||
if self.tpjobs.size > 0
|
||||
print_line("TesterPresent is currently active")
|
||||
self.tpjobs.each_index do |jid|
|
||||
if self.tpjobs[jid]
|
||||
|
|
|
@ -185,7 +185,7 @@ class Console::CommandDispatcher::Core
|
|||
if mod
|
||||
print_line(::Msf::Serializer::ReadableText.dump_module(mod))
|
||||
mod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, ' ')
|
||||
print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length.positive?
|
||||
print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -204,7 +204,7 @@ class Console::CommandDispatcher::Core
|
|||
# Get the HW bridge devices status
|
||||
#
|
||||
def cmd_status(*args)
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_status_help
|
||||
return true
|
||||
end
|
||||
|
@ -235,7 +235,7 @@ class Console::CommandDispatcher::Core
|
|||
# Get the Hardware specialty
|
||||
#
|
||||
def cmd_specialty(*args)
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_specialty_help
|
||||
return true
|
||||
end
|
||||
|
@ -251,7 +251,7 @@ class Console::CommandDispatcher::Core
|
|||
# Performs a device reset or factory reset
|
||||
#
|
||||
def cmd_reset(*args)
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_reset_help
|
||||
return
|
||||
end
|
||||
|
@ -268,7 +268,7 @@ class Console::CommandDispatcher::Core
|
|||
# Perform a device reboot
|
||||
#
|
||||
def cmd_reboot(*args)
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_reboot_help
|
||||
return
|
||||
end
|
||||
|
@ -286,7 +286,7 @@ class Console::CommandDispatcher::Core
|
|||
# Loads custom methods if any exist
|
||||
#
|
||||
def cmd_load_custom_methods(*args)
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_load_custom_methods_help
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ class Console::CommandDispatcher::RFtransceiver
|
|||
return
|
||||
end
|
||||
indexes = indexes['indexes']
|
||||
unless indexes.size.positive?
|
||||
unless indexes.size > 0
|
||||
print_line('none')
|
||||
return
|
||||
end
|
||||
|
@ -535,7 +535,7 @@ class Console::CommandDispatcher::RFtransceiver
|
|||
|
||||
def cmd_lowball(*args)
|
||||
self.idx ||= 0
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_lowball_help
|
||||
return
|
||||
end
|
||||
|
@ -552,7 +552,7 @@ class Console::CommandDispatcher::RFtransceiver
|
|||
#
|
||||
def cmd_maxpower(*args)
|
||||
self.idx ||= 0
|
||||
if args.length.positive?
|
||||
if args.length > 0
|
||||
cmd_maxpower_help
|
||||
return
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@ class Console::CommandDispatcher::Zigbee
|
|||
return
|
||||
end
|
||||
devices = devices["devices"]
|
||||
unless devices.size.positive?
|
||||
unless devices.size > 0
|
||||
print_line("none")
|
||||
return
|
||||
end
|
||||
|
|
|
@ -124,7 +124,7 @@ module Msf
|
|||
|
||||
group = "default"
|
||||
|
||||
if (@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0)
|
||||
if (@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0)
|
||||
config = { "#{group}" => { 'server' => @host, 'port' => @port } }
|
||||
::File.open("#{Aggregator_yaml}", "wb") { |f| f.puts YAML.dump(config) }
|
||||
print_good("#{Aggregator_yaml} created.")
|
||||
|
@ -376,7 +376,7 @@ module Msf
|
|||
|
||||
def aggregator_login
|
||||
|
||||
if !((@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0))
|
||||
if !((@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0))
|
||||
usage_connect
|
||||
return
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue