Use of uninitialized value $number in numeric comparison (<=>) at /usr/share/perl5/Number/Format.pm line 541.

Bug #613460 reported by Travis Hampton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnumber-format-perl (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libnumber-format-perl

https://rt.cpan.org/Public/Bug/Display.html?id=48038

--- Format.pm 2010-08-04 13:37:59.486746075 +0000
***************
*** 537,542 ****
--- 537,544 ----
      $precision = $self->{decimal_digits} unless defined $precision;
      $trailing_zeroes = $self->{decimal_fill} unless defined $trailing_zeroes;

+ unless ( defined($number) ) { $number = 0 };
+
      # Handle negative numbers
      my $sign = $number <=> 0;
      $number = abs($number) if $sign < 0;
***************
*** 786,791 ****
--- 788,795 ----
      $precision = $self->{decimal_digits} unless defined $precision; # fallback
      $precision = 2 unless defined $precision; # default

+ unless ( defined($number) ) { $number = 0 };
+
      # Determine sign and absolute value
      my $sign = $number <=> 0;
      $number = abs($number) if $sign < 0;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.