From: Vincent Pit Date: Fri, 30 Oct 2009 10:26:13 +0000 (+0100) Subject: Fix non-portable hex numbers X-Git-Tag: v1.12~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=db4cb0165515942faf7a14621767631fb02f1906;p=perl%2Fmodules%2FTest-Valgrind.git Fix non-portable hex numbers --- diff --git a/lib/Test/Valgrind/Tool/memcheck.pm b/lib/Test/Valgrind/Tool/memcheck.pm index af6f3f0..281d3f3 100644 --- a/lib/Test/Valgrind/Tool/memcheck.pm +++ b/lib/Test/Valgrind/Tool/memcheck.pm @@ -216,9 +216,9 @@ sub dump { my ($ip, $obj, $fn, $dir, $file, $line) = map { (defined) ? $_ : '?' } @$_; my $frame; if ($fn eq '?' and $obj eq '?') { - $ip =~ s/^0x//g; - $ip = hex $ip; - $frame = sprintf "0x%0${pad}X", $ip; + $ip =~ s/^0x//gi; + my $l = length $ip; + $frame = '0x' . ($l < $pad ? ('0' x ($pad - $l)) : '') . uc($ip); } else { $frame = sprintf '%s (%s) [%s:%s]', $fn, $obj, $file, $line; }