From c6577851d04ff8ef7e528c01eefccec8d387f1b9 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 29 Jun 2007 17:08:18 +0000 Subject: [PATCH] Forward port of diskUsage display bug. %d uses the native integer, which overflows on 2**32 on summaries. Changed it to use %.0f instead. --- docs/changelog/7.x.x.txt | 2 ++ sbin/diskUsage.pl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7903297e9..a6a353600 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -54,6 +54,8 @@ http://www.webgui.org/bugs/tracker/deactivated-users-subscriptions - fix: Matrix: filling out no fields leads to unapprovable listing (perlDreamer Consulting, LLC) http://www.webgui.org/bugs/tracker/matrix-filling-out-no-fields-leads-to-unapprovable-listing + - fix: DiskUsage will return -1 if value too large (perlDreamer Consulting, LLC) + http://www.webgui.org/bugs/tracker/diskusage-will-return--1-if-value-too-large 7.3.19 - Fixed a formatting problem in the workflow editor screen. diff --git a/sbin/diskUsage.pl b/sbin/diskUsage.pl index 64d3cfb06..26cea6cae 100644 --- a/sbin/diskUsage.pl +++ b/sbin/diskUsage.pl @@ -132,7 +132,7 @@ sub du { # Format to a whole number unless the total is less than 1. If it's less than 1 attempt to display 2 digits of precision to avoid displaying a zero size. unless ($totalSize < 1) { - $totalSize = sprintf("%d", $totalSize); + $totalSize = sprintf("%.0f", $totalSize); } else { $totalSize = sprintf("%.2f", $totalSize);