summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-01-31 10:15:58 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-01-31 10:15:58 +0100
commitf48061576e6c23e6fab8e6de7a6a881ebcbde62e (patch)
tree058847708d07819a5e196df478d9cc0ca3597b00
parent1884b72ff3351dd1ce6d07f35af127507fd6a675 (diff)
downloadvdr-f48061576e6c23e6fab8e6de7a6a881ebcbde62e.tar.gz
vdr-f48061576e6c23e6fab8e6de7a6a881ebcbde62e.tar.bz2
Fixed the SVDRP command 'STAT DISK' to avoid a 'division by 0' in case the disk is full
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY4
-rw-r--r--svdrp.c9
3 files changed, 11 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 1f8e02a8..df80aa46 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -921,3 +921,7 @@ Christian Tramnitz <maillist@tramnitz.com>
for terrestrial transponders
for his support in debugging a problem in setting the source type for newly
detected terrestrial transponders
+
+Jens Rosenboom <me@jayr.de>
+ for fixing the SVDRP command 'STAT DISK' to avoid a 'division by 0' in case
+ the disk is full
diff --git a/HISTORY b/HISTORY
index 965d509b..0eccb5c2 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2627,7 +2627,9 @@ Video Disk Recorder Revision History
- Added a call to cStatus::MsgOsdCurrentItem() to cMenuEditItem::SetValue()
(thanks to Martin Hammerschmid).
-2004-01-25: Version 1.3.4
+2004-01-31: Version 1.3.4
- Fixed handling language codes in case there is no audio or Dolby PID.
- Fixed handling CA ids (was broken in 1.3.4).
+- Fixed the SVDRP command 'STAT DISK' to avoid a 'division by 0' in case the
+ disk is full (thanks to Jens Rosenboom).
diff --git a/svdrp.c b/svdrp.c
index 6191182a..4ade5ec9 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 1.58 2004/01/17 15:41:52 kls Exp $
+ * $Id: svdrp.c 1.59 2004/01/31 10:13:50 kls Exp $
*/
#include "svdrp.h"
@@ -968,10 +968,9 @@ void cSVDRP::CmdSTAT(const char *Option)
{
if (*Option) {
if (strcasecmp(Option, "DISK") == 0) {
- int FreeMB;
- int Percent = VideoDiskSpace(&FreeMB);
- int Total = (FreeMB / (100 - Percent)) * 100;
- Reply(250, "%dMB %dMB %d%%", Total, FreeMB, Percent);
+ int FreeMB, UsedMB;
+ int Percent = VideoDiskSpace(&FreeMB, &UsedMB);
+ Reply(250, "%dMB %dMB %d%%", FreeMB + UsedMB, FreeMB, Percent);
}
else
Reply(501, "Invalid Option \"%s\"", Option);