cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_getdate

From: Tetetest <tetetest_at_rambler.ru>
Date: Wed, 22 Jun 2011 00:49:04 +0400

Hello Daniel,

Wednesday, June 22, 2011, 12:03:28 AM, you wrote:

DS> + if((mdaynum >> 31) || (monnum > 11) ||
DS> + (hournum >> 23) || (minnum > 59) || (secnum > 59))
DS> + return PARSEDATE_FAIL; /* clearly an illegal date */

Well, to be pedantic, secnum can be equal to 60 on some very special
occasions (when the year length is corrected for leap seconds, see
http://en.wikipedia.org/wiki/Leap_second ). So the correct comparison
should be:

if((mdaynum >> 31) || (monnum > 11) ||
    (hournum >> 23) || (minnum > 59) || (secnum > 60))
    return PARSEDATE_FAIL; /* clearly an illegal date */

-- 
Best regards,
 Tetetest                            mailto:tetetest_at_rambler.ru
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-21