Make sure the substration is made using two doubles. Since value is unsigned negative results might overflow otherwise. This closes #177

This commit is contained in:
Micke Prag 2012-01-26 12:42:56 +01:00
parent f1e58433c1
commit 1ef4610f52

View file

@ -12,7 +12,7 @@ std::string ProtocolMandolyn::decodeData(ControllerMessage &dataMsg)
bool parity = value & 0x1;
value >>= 1;
double temp = (value & 0x7FFF) - 6400;
double temp = (double)(value & 0x7FFF) - (double)6400;
temp = temp/128.0;
value >>= 15;