This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strptime() could hangs for hours


On Mar 31 11:58, Howland Craig D (Craig) wrote:
> 2011-03-30  Craig Howland <...>
> 
> 	* libc/time/strptime.c:  Initialize given struct tm before use;
> 	move application of %U, %W, and %V formats to the end so that have
> 	a valid year to use first; re-write first_day() helper function
> 	to be faster for large values and to work for year < 1970; limit
> 	year to 1753 or later.

Thanks for the patch.  I don't think it's right to limit the date
to >= 1753, though.  Think about it:

  strptime ("Apr 01, 1489", "%b %d, %Y", tm_ptr);

There's no good reason to treat this as wrong.  If anything, you could
skip the %[UVW] handling for dates < 1753.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]