the '.*' was greedy, also consuming all but one digits of the real percentage
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
switch to \s* instead of .*?, to prevent mis-interpreting potential
strings like '< 50%' or '0-50%'
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
$smartdata->{text} = '' if !defined $smartdata->{text};
$smartdata->{text} .= "$line\n";
# extract wearout from nvme text, allow for decimal values
- if ($line =~ m/Percentage Used:.*(\d+(?:\.\d+)?)\%/i) {
+ if ($line =~ m/Percentage Used:\s*(\d+(?:\.\d+)?)\%/i) {
$smartdata->{wearout} = 100 - $1;
}
} elsif ($line =~ m/SMART Disabled/) {