add: test

add: period filters
fix: invalid reads (lost invalid json debug output)
This commit is contained in:
Tobias Reisinger 2020-05-29 00:57:09 +02:00
parent f2a40ca330
commit 2d992cfe3c
6 changed files with 181 additions and 32 deletions
models

View file

@ -31,6 +31,15 @@ period_helper_parse_hhmm(const char *hhmm_str, uint16_t *hhmm)
tmp_h = (uint16_t)strtol(&hhmm_str[0], NULL, 10);
tmp_m = (uint16_t)strtol(&hhmm_str[3], NULL, 10);
if(tmp_h > 24 || tmp_m >= 60)
{
return 1;
}
if(tmp_h == 24 && tmp_m > 0)
{
return 1;
}
*hhmm = (tmp_h * 60) + tmp_m;
return 0;