Out of bounds protection for telemetryItems[] array access and some code refactoring for telemetry value precision

This commit is contained in:
Damjan Adamic
2015-10-18 12:06:25 +02:00
parent 4ef9913f76
commit 082ba0893d
8 changed files with 49 additions and 28 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ static void luaGetValueAndPush(int src)
break;
default:
if (telemetrySensor.prec > 0)
lua_pushnumber(L, float(value)/(telemetrySensor.prec == 2 ? 100.0 : 10.0));
lua_pushnumber(L, float(value)/telemetrySensor.getPrecDivisor());
else
lua_pushinteger(L, value);
break;