Skip to content

Commit a78c92c

Browse files
committed
parser BUGFIX handle DST time changes properly
Fixes #623
1 parent aa75ecb commit a78c92c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/parser.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,9 @@ lyp_check_date(struct ly_ctx *ctx, const char *date)
24352435
if (!r || r != &date[LY_REV_SIZE - 1]) {
24362436
goto error;
24372437
}
2438+
/* set some arbitrary non-0 value in case DST changes, it could move the day otherwise */
2439+
tm.tm_hour = 12;
2440+
24382441
memcpy(&tm_, &tm, sizeof tm);
24392442
mktime(&tm_); /* mktime modifies tm_ if it refers invalid date */
24402443
if (tm.tm_mday != tm_.tm_mday) { /* e.g 2018-02-29 -> 2018-03-01 */

0 commit comments

Comments
 (0)