Browse Source

remove more instances of positive?

Brent Cook 2 years ago
parent
commit
24d323d4ed

+ 1
- 1
lib/msf/core/post/hardware/automotive/uds.rb View File

@@ -33,7 +33,7 @@ module UDS
33 33
       end
34 34
       left2combine = hash["Packets"].size
35 35
       counter = 0
36
-      while left2combine.positive? && (bad_count < (hash["Packets"].size * 2))
36
+      while left2combine > 0 && (bad_count < (hash["Packets"].size * 2))
37 37
         # print_line("DEBUG Current status combine=#{left2combine} data=#{data.inspect}")
38 38
         hash["Packets"].each do |pkt|
39 39
           if (pkt.key? "ID") && pkt["ID"].hex == id.hex

+ 1
- 1
lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb View File

@@ -269,7 +269,7 @@ class Console::CommandDispatcher::Automotive
269 269
       return
270 270
     end
271 271
     if id.blank? && !stop
272
-      if self.tpjobs.size.positive?
272
+      if self.tpjobs.size > 0
273 273
         print_line("TesterPresent is currently active")
274 274
         self.tpjobs.each_index do |jid|
275 275
           if self.tpjobs[jid]

+ 6
- 6
lib/rex/post/hwbridge/ui/console/command_dispatcher/core.rb View File

@@ -185,7 +185,7 @@ class Console::CommandDispatcher::Core
185 185
     if mod
186 186
       print_line(::Msf::Serializer::ReadableText.dump_module(mod))
187 187
       mod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, '   ')
188
-      print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length.positive?
188
+      print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length > 0
189 189
     end
190 190
   end
191 191
 
@@ -204,7 +204,7 @@ class Console::CommandDispatcher::Core
204 204
   # Get the HW bridge devices status
205 205
   #
206 206
   def cmd_status(*args)
207
-    if args.length.positive?
207
+    if args.length > 0
208 208
       cmd_status_help
209 209
       return true
210 210
     end
@@ -235,7 +235,7 @@ class Console::CommandDispatcher::Core
235 235
   # Get the Hardware specialty
236 236
   #
237 237
   def cmd_specialty(*args)
238
-    if args.length.positive?
238
+    if args.length > 0
239 239
       cmd_specialty_help
240 240
       return true
241 241
     end
@@ -251,7 +251,7 @@ class Console::CommandDispatcher::Core
251 251
   # Performs a device reset or factory reset
252 252
   #
253 253
   def cmd_reset(*args)
254
-    if args.length.positive?
254
+    if args.length > 0
255 255
       cmd_reset_help
256 256
       return
257 257
     end
@@ -268,7 +268,7 @@ class Console::CommandDispatcher::Core
268 268
   # Perform a device reboot
269 269
   #
270 270
   def cmd_reboot(*args)
271
-    if args.length.positive?
271
+    if args.length > 0
272 272
       cmd_reboot_help
273 273
       return
274 274
     end
@@ -286,7 +286,7 @@ class Console::CommandDispatcher::Core
286 286
   # Loads custom methods if any exist
287 287
   #
288 288
   def cmd_load_custom_methods(*args)
289
-    if args.length.positive?
289
+    if args.length > 0
290 290
       cmd_load_custom_methods_help
291 291
       return true
292 292
     end

+ 3
- 3
lib/rex/post/hwbridge/ui/console/command_dispatcher/rftransceiver.rb View File

@@ -49,7 +49,7 @@ class Console::CommandDispatcher::RFtransceiver
49 49
       return
50 50
     end
51 51
     indexes = indexes['indexes']
52
-    unless indexes.size.positive?
52
+    unless indexes.size > 0
53 53
       print_line('none')
54 54
       return
55 55
     end
@@ -535,7 +535,7 @@ class Console::CommandDispatcher::RFtransceiver
535 535
 
536 536
   def cmd_lowball(*args)
537 537
     self.idx ||= 0
538
-    if args.length.positive?
538
+    if args.length > 0
539 539
       cmd_lowball_help
540 540
       return
541 541
     end
@@ -552,7 +552,7 @@ class Console::CommandDispatcher::RFtransceiver
552 552
   #
553 553
   def cmd_maxpower(*args)
554 554
     self.idx ||= 0
555
-    if args.length.positive?
555
+    if args.length > 0
556 556
       cmd_maxpower_help
557 557
       return
558 558
     end

+ 1
- 1
lib/rex/post/hwbridge/ui/console/command_dispatcher/zigbee.rb View File

@@ -44,7 +44,7 @@ class Console::CommandDispatcher::Zigbee
44 44
       return
45 45
     end
46 46
     devices = devices["devices"]
47
-    unless devices.size.positive?
47
+    unless devices.size > 0
48 48
       print_line("none")
49 49
       return
50 50
     end

+ 2
- 2
plugins/aggregator.rb View File

@@ -124,7 +124,7 @@ module Msf
124 124
 
125 125
         group = "default"
126 126
 
127
-        if (@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0)
127
+        if (@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0)
128 128
           config = { "#{group}" => { 'server' => @host, 'port' => @port } }
129 129
           ::File.open("#{Aggregator_yaml}", "wb") { |f| f.puts YAML.dump(config) }
130 130
           print_good("#{Aggregator_yaml} created.")
@@ -376,7 +376,7 @@ module Msf
376 376
 
377 377
       def aggregator_login
378 378
 
379
-        if !((@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0))
379
+        if !((@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0))
380 380
           usage_connect
381 381
           return
382 382
         end

Loading…
Cancel
Save