mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-06-28 15:39:02 +08:00
bug #688655
This commit is contained in:
parent
181de01e4f
commit
ee53cdd230
@ -1,5 +1,6 @@
|
|||||||
Sun Feb 15 07:37:19 EST 2004 Brian Bruns <brian@bruns.com>
|
Sun Feb 15 07:37:19 EST 2004 Brian Bruns <brian@bruns.com>
|
||||||
* src/gmdb2/debug.c: move declarations to top of function, fixes bug 675022
|
* src/gmdb2/debug.c: move declarations to top of function, fixes bug 675022
|
||||||
|
* src/gmdb2/debug.c: merge patch for bug #688655, check negative values on datetime
|
||||||
|
|
||||||
Sat Feb 14 14:41:00 EST 2004 Brian Bruns <brian@bruns.com>
|
Sat Feb 14 14:41:00 EST 2004 Brian Bruns <brian@bruns.com>
|
||||||
* include/.cvsignore: add mdbver.h
|
* include/.cvsignore: add mdbver.h
|
||||||
|
@ -1023,12 +1023,12 @@ static int trim_trailing_zeros(char * buff, int n)
|
|||||||
|
|
||||||
char *mdb_col_to_string(MdbHandle *mdb, unsigned char *buf, int start, int datatype, int size)
|
char *mdb_col_to_string(MdbHandle *mdb, unsigned char *buf, int start, int datatype, int size)
|
||||||
{
|
{
|
||||||
/* FIX ME -- not thread safe */
|
/* FIX ME -- not thread safe */
|
||||||
static char text[MDB_BIND_SIZE];
|
static char text[MDB_BIND_SIZE];
|
||||||
time_t t;
|
time_t t;
|
||||||
int i, n;
|
int i, n;
|
||||||
float tf;
|
float tf;
|
||||||
double td;
|
double td;
|
||||||
|
|
||||||
switch (datatype) {
|
switch (datatype) {
|
||||||
case MDB_BOOL:
|
case MDB_BOOL:
|
||||||
@ -1087,9 +1087,13 @@ double td;
|
|||||||
return text;
|
return text;
|
||||||
break;
|
break;
|
||||||
case MDB_SDATETIME:
|
case MDB_SDATETIME:
|
||||||
t = (long int)((mdb_get_double(buf, start) - 25569.0) * 86400.0);
|
td = mdb_get_double(mdb, start);
|
||||||
strftime(text, MDB_BIND_SIZE, date_fmt,
|
if (td > 1) {
|
||||||
(struct tm*)gmtime(&t));
|
t = (long int)((td - 25569.0) * 86400.0);
|
||||||
|
} else {
|
||||||
|
t = (long int)(td * 86400.0);
|
||||||
|
}
|
||||||
|
strftime(text, MDB_BIND_SIZE, date_fmt, (struct tm*)gmtime(&t));
|
||||||
return text;
|
return text;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user