Skip to Content.
Sympa Menu

freetds - Re: Bizarre date wraparound bug

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Bizarre date wraparound bug
  • Date: Tue, 16 Oct 2001 19:08:40 -0400 (EDT)


from src/tds/convert.c:

TDS_INT tds_convert_datetime(int srctype,unsigned char *src,int
desttype,unsigned char *dest,TDS_INT destlen)
{
TDS_INT dtdays, dttime;
time_t tmp_secs_from_epoch;

switch(desttype) {
case SYBCHAR:
case SYBVARCHAR:
/* FIX ME -- This fails for dates before 1902 or after 2038 */
if (destlen<0) {
memset(dest,' ',30);
} else {
memset(dest,' ',destlen);
}
if (!src) {
*dest='\0';
return 0;
}
memcpy(&dtdays, src, 4);
memcpy(&dttime, src+4, 4);


Anybody wanna take a crack at fixing it?

On Tue, 16 Oct 2001, Craig Davison wrote:

> On Tue, 16 Oct 2001, Michael Peppler wrote:
>
> > I guess FreeTDS takes a short cut and converts the data to standard
> > time_t format (which is OK for most things, of course).
>
> Sorry for the numerous posts, but maybe this should be in the FAQ?
>
> Thanks for your reply.
>
>





Archive powered by MHonArc 2.6.24.

Top of Page