Revert "fix: Potential out of bounds access of flightmode name on main screen (#1337)"
This reverts commit 1b6f827b2c.
This commit is contained in:
@@ -328,8 +328,8 @@ void ViewMainDecoration::createFlightMode()
|
||||
};
|
||||
|
||||
std::function<std::string()> getFM = []() -> std::string {
|
||||
return stringFromNtString(g_model.flightModeData[mixerCurrentFlightMode].name);
|
||||
};
|
||||
return g_model.flightModeData[mixerCurrentFlightMode].name;
|
||||
};
|
||||
|
||||
flightMode = new DynamicText(this, r, getFM, CENTERED | COLOR_THEME_SECONDARY1);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#include "definitions.h"
|
||||
#include "opentx_types.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#define SHOW_TIME 0x1
|
||||
#define SHOW_TIMER 0x0
|
||||
#define SHOW_TIMER_UPPER_CASE 0x2
|
||||
@@ -92,8 +90,4 @@ char *getTimerString(int32_t tme, TimerOptions timerOptions = {.options = 0});
|
||||
void splitTimer(char *s0, char *s1, char *s2, char *s3, int tme,
|
||||
bool bLowercase = true);
|
||||
|
||||
template<size_t N>
|
||||
constexpr std::string stringFromNtString(const char (&a)[N]) {
|
||||
return std::string(a, strnlen(a, N));
|
||||
}
|
||||
#endif // _STRHELPERS_H_
|
||||
|
||||
Reference in New Issue
Block a user