summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-12-24 10:56:47 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2021-12-24 10:56:47 +0100
commit104bddc56068d6d613d6f159d5d7380ac0f7ab68 (patch)
tree0744d870e88b821b39625f2c1784d75709cb4e45
parente7107b789e141005c01319a680a43f800e85413c (diff)
downloadvdr-104bddc56068d6d613d6f159d5d7380ac0f7ab68.tar.gz
vdr-104bddc56068d6d613d6f159d5d7380ac0f7ab68.tar.bz2
Fixed calculating the disk use percentage if there's more than 20TB of recordings
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY4
-rw-r--r--videodir.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index dd6c513c..4a13b439 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3703,3 +3703,7 @@ Bernd Kuhls <bernd.kuhls@t-online.de>
Ulf Grüne <ulf.gruene@t-online.de>
for reporting the need for more than 15 modulation systems in cDevice::GetDevice()
+
+Timo Weingärtner <timo@tiwe.de>
+ for reporting an integer overflow in calculating the disk use percentage if there's
+ more than 20TB of recordings
diff --git a/HISTORY b/HISTORY
index 8f72f6e1..c5159088 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9747,6 +9747,8 @@ Video Disk Recorder Revision History
Haubrich).
- Fixed a memory leak in handling the NIT (thanks to Helmut Binder).
-2021-12-20:
+2021-12-24:
- Fixed a possible memory leak in creating fonts (reported by Helmut Binder).
+- Fixed calculating the disk use percentage if there's more than 20TB of recordings
+ (reported by Timo Weingärtner).
diff --git a/videodir.c b/videodir.c
index c5545285..d01a1d9f 100644
--- a/videodir.c
+++ b/videodir.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: videodir.c 5.1 2021/01/19 20:38:28 kls Exp $
+ * $Id: videodir.c 5.2 2021/12/24 10:56:47 kls Exp $
*/
#include "videodir.h"
@@ -163,7 +163,7 @@ int cVideoDirectory::VideoDiskSpace(int *FreeMB, int *UsedMB)
*FreeMB = free;
if (UsedMB)
*UsedMB = used;
- return (free + used) ? used * 100 / (free + used) : 0;
+ return (free + used) ? round(double(used) * 100 / (free + used)) : 0;
}
cString cVideoDirectory::PrefixVideoFileName(const char *FileName, char Prefix)