From a56dd5d1ff5afec6bde5352359a2690eee45bd17 Mon Sep 17 00:00:00 2001 From: jvazquez-r7 Date: Mon, 20 Apr 2015 15:44:45 -0500 Subject: [PATCH] Do minor style cleanup --- lib/msf/core/option_container.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/msf/core/option_container.rb b/lib/msf/core/option_container.rb index 479f5590d0..a3ec186e26 100644 --- a/lib/msf/core/option_container.rb +++ b/lib/msf/core/option_container.rb @@ -378,17 +378,18 @@ class OptAddressRange < OptBase def normalize(value) return nil unless value.kind_of?(String) - if (value =~ /^rand:(.*)/) + if value =~ /^rand:(.*)/ count = $1.to_i return false if count < 1 ret = '' - count.times { - ret << " " if not ret.empty? - ret << [ rand(0x100000000) ].pack("N").unpack("C*").map{|x| x.to_s }.join(".") - } + count.times do + ret << ' ' unless ret.empty? + ret << [ rand(0x100000000) ].pack('N').unpack('C*').map{|x| x.to_s }.join('.') + end return ret end - return value + + value end def valid?(value)