[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]: Re: Date processing should be more flexible

From: Christer J. <christer.nyfalt_at_welho.com>
Date: 2005-07-05 05:21:32 CEST

On Mon, 2005-07-04 at 22:56 -0400, Christopher Ness wrote:

>
> This patch also forces the day to be greater than 0. Not sure if this
> will break any scripts, but a day of 0 didn't make sense to me.
>
   /* Range validation, allowing for leap seconds */
   if (expt.tm_mon < 0 || expt.tm_mon > 11
       || expt.tm_mday > valid_days_by_month[expt.tm_mon]
+ || expt.tm_mday <= 0
       || expt.tm_hour > 23
       || expt.tm_min > 59
       || expt.tm_sec > 60)

>
> Cheers,
> Chris

If valid months go from 0 to 11, wouldn't that mean that the internal
representation of months are real month number - 1? That makes me
suspect that the same case could be true for days also.
Or in short, have you checked that the first of a month is tm_mday == 1
and not tm_mday == 0?

-- 
Christer J. Nyfält <christer.nyfalt@welho.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jul 5 05:23:01 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.