diff --git a/src/DUNE/Utils/String.cpp b/src/DUNE/Utils/String.cpp index de8ab4de84..ec9d8a49de 100644 --- a/src/DUNE/Utils/String.cpp +++ b/src/DUNE/Utils/String.cpp @@ -82,7 +82,13 @@ namespace DUNE void String::rightTrimInPlace(char* str) { - char* r = str + std::strlen(str) - 1; // Rightmost character + const auto len = std::strlen(str); + + // smaller than two characters, nothing to trim + if (len < 2) + return; + + char* r = str + len - 1; // Rightmost character for (; isspace(*r); --r) *r = 0; diff --git a/src/Simulators/VSIM/Factory.cpp b/src/Simulators/VSIM/Factory.cpp index 5bae16a508..cb1d33834d 100644 --- a/src/Simulators/VSIM/Factory.cpp +++ b/src/Simulators/VSIM/Factory.cpp @@ -147,7 +147,7 @@ namespace Simulators double force[3]; double position[3]; - double orientation[2]; + double orientation[3]; // Retrieve fins. unsigned fins;