Minor formatting fixes.

This commit is contained in:
2023-09-29 01:02:45 +02:00
parent c86e41b977
commit ed8e4dd9ef

View File

@@ -169,7 +169,7 @@ String time_to_string(uint8_t hours, uint8_t minutes)
{ {
hours++; hours++;
} }
if (hours > 12) // 24h -> 12h, except 12h if (hours > 12) // 24h -> 12h, except 12h
{ {
hours -= 12; hours -= 12;
} }
@@ -251,6 +251,7 @@ String split(String s, char parser, int index)
String rs = ""; String rs = "";
int parser_cnt = 0; int parser_cnt = 0;
int r_from_index = 0, r_to_index = -1; int r_from_index = 0, r_to_index = -1;
while (index >= parser_cnt) while (index >= parser_cnt)
{ {
r_from_index = r_to_index + 1; r_from_index = r_to_index + 1;
@@ -264,7 +265,9 @@ String split(String s, char parser, int index)
return s.substring(r_from_index, r_to_index); return s.substring(r_from_index, r_to_index);
} }
else else
{
parser_cnt++; parser_cnt++;
}
} }
return rs; return rs;
} }