]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind/Tool/memcheck.pm
Fix non-portable hex numbers
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind / Tool / memcheck.pm
index af6f3f0bb98ed39fbfdeca3ac57c7a2495048fd0..281d3f3c7dca8120956d5fd0a2173e8cd848e161 100644 (file)
@@ -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;
    }