From d1125fc6a99c9f812a0bc688e1b8035a68c977c9 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 2 Jan 2020 15:55:02 -0500 Subject: [PATCH] 2020-01-02 Fred Gleason * Fixed a bug in the 'rivwebcapi' validate_tm() function that caused dates containing '29 February' to always fail regardless of leap-year validity. --- ChangeLog | 4 ++++ apis/rivwebcapi/rivwebcapi/rd_common.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b916d7c9..ce4dab8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19379,3 +19379,7 @@ * Tweaked the 'LogLineBox::mouseMoveEvent()' method in rdairplay(1) to require a cursor movement of at least 20 pixels before generating a cart drag. +2020-01-02 Fred Gleason + * Fixed a bug in the 'rivwebcapi' validate_tm() function that caused + dates containing '29 February' to always fail regardless of leap-year + validity. diff --git a/apis/rivwebcapi/rivwebcapi/rd_common.c b/apis/rivwebcapi/rivwebcapi/rd_common.c index b1154d31..66f68713 100644 --- a/apis/rivwebcapi/rivwebcapi/rd_common.c +++ b/apis/rivwebcapi/rivwebcapi/rd_common.c @@ -2,7 +2,7 @@ * * Common Utility Functions for the Rivendell Access Library * - * (C) Copyright 2015 Fred Gleason + * (C) Copyright 2015-2019 Fred Gleason * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -234,7 +234,9 @@ int validate_tm (struct tm *tmptr) leap = 1; else leap = 0; - if (!leap) + if (leap) + monthdays[1]=29; + else return 0; } if ( (tmptr->tm_mday > monthdays[tmptr->tm_mon]) ||