Skip to content

Commit

Permalink
avoid warnings for undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch authored and Gonéri Le Bouder committed May 24, 2012
1 parent a2d0019 commit e3c876a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/FusionInventory/Agent/Tools/Network.pm
Expand Up @@ -71,13 +71,15 @@ sub getSubnetAddressIPv6 {

sub hex2canonical {
my ($address) = @_;
return unless $address;

my @bytes = $address =~ /^(?:0x)?(..)(..)(..)(..)$/;
return join('.', map { hex($_) } @bytes);
}

sub alt2canonical {
my ($address) = @_;
return unless $address;

my @bytes = $address =~ /^(?:0x)?(..)(..)(..)(..)(..)(..)$/;
return join(':', @bytes);
Expand Down

0 comments on commit e3c876a

Please sign in to comment.