localtime func crash in windows
This commit is contained in:
parent
7da7b6177c
commit
f790a124b1
|
@ -379,6 +379,10 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WINDOWS
|
||||||
|
if (tt < 0) tt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct tm* ptm = localtime(&tt);
|
struct tm* ptm = localtime(&tt);
|
||||||
size_t pos = strftime(buf, 32, "%Y-%m-%d %H:%M:%S", ptm);
|
size_t pos = strftime(buf, 32, "%Y-%m-%d %H:%M:%S", ptm);
|
||||||
|
|
||||||
|
|
|
@ -791,6 +791,10 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef WINDOWS
|
||||||
|
if (tt < 0) tt = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
tp = localtime(&tt);
|
tp = localtime(&tt);
|
||||||
strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", tp);
|
strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", tp);
|
||||||
sprintf(value, "%s.%03d", timeStr,
|
sprintf(value, "%s.%03d", timeStr,
|
||||||
|
|
Loading…
Reference in New Issue