[pve-devel] [PATCH manager v2] fix #2030: use looks_like_number for number check

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jan 7 09:54:48 CET 2019


On Fri, Jan 04, 2019 at 04:12:08PM +0100, Dominik Csapak wrote:
> (...)
> @@ -156,13 +159,21 @@ sub get_recursive_values {
>  sub prepare_value {
>      my ($value) = @_;
>  
> +    if (looks_like_number($value)) {
> +	if ($value eq 'NaN' || $value =~ /^Inf/) {

Just noticed that the Inf check is anchored on the left.
    $ perl -e 'print(-9**9**9);'
    -Inf

Maybe use POSIX::isinf and POSIX::isnan instead?




More information about the pve-devel mailing list