mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
Use re-entrant functions in a couple of places
Replace strtok and gmtime with their re-entrant versions. More to come.
This commit is contained in:
@@ -760,8 +760,9 @@ int mdb_sql_find_sargcol(MdbSargNode *node, gpointer data)
|
||||
* Plain integers are UNIX timestamps for backwards compatibility of parser
|
||||
*/
|
||||
if (col->col_type == MDB_DATETIME && node->val_type == MDB_INT) {
|
||||
struct tm *tm = gmtime((time_t*)&node->value.i);
|
||||
mdb_tm_to_date(tm, &node->value.d);
|
||||
struct tm tm;
|
||||
gmtime_r((time_t*)&node->value.i, &tm);
|
||||
mdb_tm_to_date(&tm, &node->value.d);
|
||||
node->val_type = MDB_DOUBLE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user