replace atol with atoll to fix result size display bug. Also use atoll for time conversions, 2032 is coming...
This commit is contained in:
@@ -612,7 +612,7 @@ void Preview::setCurTabProps(const Rcl::Doc &doc, int docnum)
|
||||
datebuf[0] = 0;
|
||||
if (!doc.fmtime.empty() || !doc.dmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%Y-%m-%d %H:%M:%S", tm);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ static string dategetter(const string&, const Rcl::Doc& doc)
|
||||
datebuf[0] = 0;
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%Y-%m-%d", tm);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ static string datetimegetter(const string&, const Rcl::Doc& doc)
|
||||
datebuf[0] = 0;
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
time_t mtime = doc.dmtime.empty() ?
|
||||
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
|
||||
atoll(doc.fmtime.c_str()) : atoll(doc.dmtime.c_str());
|
||||
struct tm *tm = localtime(&mtime);
|
||||
strftime(datebuf, 99, "%Y-%m-%d %H:%M:%S %z", tm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user