@@ -518,7 +518,7 @@ static struct error_record *day_type_parse(const struct expr *sym,
return error(&sym->location, "Day name must be at least three characters long");
}
- for (unsigned i = 0; i < numdays && daynum == -1; i++) {
+ for (int i = 0; i < numdays && daynum == -1; i++) {
daylen = strlen(days[i]);
if (strncasecmp(sym->identifier,
@@ -621,8 +621,8 @@ convert:
/* Substract tm_gmtoff to get the current time */
if (cur_tm) {
- if (result >= cur_tm->tm_gmtoff)
- result -= cur_tm->tm_gmtoff;
+ if ((long int) result >= cur_tm->tm_gmtoff)
+ result = (result - cur_tm->tm_gmtoff) % 86400;
else
result = 86400 - cur_tm->tm_gmtoff + result;
}
Signed-off-by: Ander Juaristi <a@juaristi.eus> --- src/meta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)