From 933766120f28ad525cdb12261aee900a992d0384 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 7 Oct 2021 16:52:33 +0100 Subject: [PATCH] fix sprintf to printf --- lib/SNMP/Info/IPv6.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/SNMP/Info/IPv6.pm b/lib/SNMP/Info/IPv6.pm index ff67383e..4ef354d7 100644 --- a/lib/SNMP/Info/IPv6.pm +++ b/lib/SNMP/Info/IPv6.pm @@ -377,9 +377,8 @@ sub ipv6_addr { my $addrsize = shift @parts; # First element now is addrsize, should be 16 if ($is_valid && $addrsize == 16) { $return->{$row} = join(':', unpack('(H4)*', pack('C*', @parts))); - } else { - sprintf("%s: unable to decode table index to IPv6 address. Raw data is [%s].\n", &_my_sub_name, $row) - if $info->debug(); + } elsif ($info->debug()) { + printf("%s: unable to decode table index to IPv6 address. Raw data is [%s].\n", &_my_sub_name, $row); } } return $return;