mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-11 14:07:00 +03:00
Fix timezone config parser (#2169)
* make sure to parse the whole config line * fix crash on empty timezone parameter --------- Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -175,11 +175,16 @@ bool setupTime() {
|
|||||||
|
|
||||||
while (configFile.getNextLine(&line, disabledLine, eof) &&
|
while (configFile.getNextLine(&line, disabledLine, eof) &&
|
||||||
!configFile.isNewParagraph(line)) {
|
!configFile.isNewParagraph(line)) {
|
||||||
splitted = ZerlegeZeile(line);
|
splitted = ZerlegeZeile(line, "=");
|
||||||
|
|
||||||
if (toUpper(splitted[0]) == "TIMEZONE") {
|
if (toUpper(splitted[0]) == "TIMEZONE") {
|
||||||
|
if (splitted.size() <= 1) { // parameter part is empty
|
||||||
|
timeZone = "";
|
||||||
|
}
|
||||||
|
else {
|
||||||
timeZone = splitted[1];
|
timeZone = splitted[1];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (toUpper(splitted[0]) == "TIMESERVER") {
|
if (toUpper(splitted[0]) == "TIMESERVER") {
|
||||||
if (splitted.size() <= 1) { // Key has no value => we use this to show it as disabled
|
if (splitted.size() <= 1) { // Key has no value => we use this to show it as disabled
|
||||||
|
|||||||
Reference in New Issue
Block a user