From a3dea40fd6fc97689e4c963d9e82e5a19c505b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Wed, 22 Feb 2012 23:36:26 +0000 Subject: [PATCH] Fixed a division by zero in the Sandforce write amplification sensor. --- Hardware/HDD/SSDSandforce.cs | 7 +++++-- Properties/AssemblyVersion.cs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Hardware/HDD/SSDSandforce.cs b/Hardware/HDD/SSDSandforce.cs index 1f0e800..ba1ab50 100644 --- a/Hardware/HDD/SSDSandforce.cs +++ b/Hardware/HDD/SSDSandforce.cs @@ -92,8 +92,11 @@ namespace OpenHardwareMonitor.Hardware.HDD { hostWritesToController = RawToInt(value.RawValue, value.AttrValue); } if (controllerWritesToNAND.HasValue && hostWritesToController.HasValue) { - writeAmplification.Value = - controllerWritesToNAND.Value / hostWritesToController.Value; + if (hostWritesToController.Value > 0) + writeAmplification.Value = + controllerWritesToNAND.Value / hostWritesToController.Value; + else + writeAmplification.Value = 0; ActivateSensor(writeAmplification); } } diff --git a/Properties/AssemblyVersion.cs b/Properties/AssemblyVersion.cs index e9bcc49..fa7709b 100644 --- a/Properties/AssemblyVersion.cs +++ b/Properties/AssemblyVersion.cs @@ -37,5 +37,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.4.0.3")] -[assembly: AssemblyInformationalVersion("0.4.0.3 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.4.0.4")] +[assembly: AssemblyInformationalVersion("0.4.0.4 Alpha")] \ No newline at end of file