mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 01:52:51 +00:00
dev.7, fix crash
This commit is contained in:
@@ -12,6 +12,8 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
||||
|
||||
- signed value for solarInfuence [#3077](https://github.com/emsesp/EMS-ESP32/issues/3077)
|
||||
- set bin file upload limit to 1M again [3086](https://github.com/emsesp/EMS-ESP32/issues/3086)
|
||||
- check arithmetric operations on strings [#3127](https://github.com/emsesp/EMS-ESP32/discussions/3127)
|
||||
- Prevent system crash during WiFi network discovery on ESP32-S3 hardware [#3128](https://github.com/emsesp/EMS-ESP32/pull/3128)
|
||||
|
||||
## Changed
|
||||
|
||||
|
||||
@@ -333,7 +333,10 @@ std::deque<Token> shuntingYard(const std::deque<Token> & tokens) {
|
||||
|
||||
// check if string is a number
|
||||
bool isnum(const std::string & s) {
|
||||
if (!s.empty() && (s.find_first_not_of("0123456789.") == std::string::npos || (s[0] == '-' && s.find_first_not_of("0123456789.", 1) == std::string::npos))) {
|
||||
if (s.empty() || s.find_first_of("0123456789") == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
if (s.find_first_not_of("0123456789.") == std::string::npos || (s[0] == '-' && s.find_first_not_of("0123456789.", 1) == std::string::npos)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -636,6 +639,10 @@ std::string calculate(const std::string & expr) {
|
||||
stack.push_back(lhs + rhs);
|
||||
break;
|
||||
}
|
||||
if (!isnum(rhs) || !isnum(lhs)) {
|
||||
stack.push_back(lhs + token.str + rhs);
|
||||
break;
|
||||
}
|
||||
auto lhd = std::stod(lhs);
|
||||
auto rhd = std::stod(rhs);
|
||||
switch (token.str[0]) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.8.3-dev.6"
|
||||
#define EMSESP_APP_VERSION "3.8.3-dev.7"
|
||||
|
||||
Reference in New Issue
Block a user