mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-22 04:24:59 +01:00
fix(sonar): addressing reliability/security issues (#202)
This commit is contained in:
@@ -1732,7 +1732,11 @@ class TMoverParameters
|
||||
// bounds-safe read access to MotorParam
|
||||
TMotorParameters const &motor_param(int const Position) const
|
||||
{
|
||||
return MotorParam[std::clamp(Position, 0, MotorParametersArraySize)];
|
||||
if (Position < 0)
|
||||
return MotorParam[0];
|
||||
if (Position > MotorParametersArraySize)
|
||||
return MotorParam[MotorParametersArraySize];
|
||||
return MotorParam[Position];
|
||||
}
|
||||
TTransmision Transmision;
|
||||
// record {liczba zebow przekladni}
|
||||
|
||||
Reference in New Issue
Block a user