On 06/15/2011 02:44 PM, Steven Abner wrote: > Hi, > First sorry to bother, second thank you for providing source code worthy of > a good > shake down, third, arghhh, using negative years I found the return value to > be off. > > Using "%V/%u/%010G", which was the flag and field we matched, > and creating a struct of Jan 1 dates, the return value differed. > The output to buffers where identical, yours reported a different > length. I haven't tried other than "%G" as a test from +- 2^29 of every > first of the year took a while.
Your description is a bit too broad to say what exactly you are finding wrong, other than you found at least one case where identical input to two strftime() implementations gave different output. Please help us help you, by giving an exact 'struct tm' contents where our strftime() implementation is differing from yours, along with the output of both versions, preferably as a standalone C program that can easily be compiled against either strftime() implementation, so that we can help pinpoint which of the two (if not both) implementations have a bug. Meanwhile, remember that POSIX documents that tm_year < -1899 produces unspecified results, since year 0 does not exist in the Gregorian or Julian calendar, so any use of %V or %Y on -1900 can meaningfully produce either "0" or "-1" -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature