mirror of https://github.com/aria2/aria2
2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Assign the value of tv.tv_sec to time_t timesec instead of giving tv.tv_sec to localtime_r directly because tv.tv_sec may not be of type time_t. * src/SimpleLogger.ccpull/1/head
parent
0a5f6751d1
commit
43796accda
|
@ -1,3 +1,10 @@
|
|||
2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Assign the value of tv.tv_sec to time_t timesec instead of giving
|
||||
tv.tv_sec to localtime_r directly because tv.tv_sec may not be of
|
||||
type time_t.
|
||||
* src/SimpleLogger.cc
|
||||
|
||||
2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added test for FtpConnection::receiveSizeResponse().
|
||||
|
|
|
@ -147,7 +147,9 @@ void SimpleLogger::writeLog(std::ostream& o, Logger::LEVEL level,
|
|||
gettimeofday(&tv, 0);
|
||||
char datestr[27]; // 'YYYY-MM-DD hh:mm:ss.uuuuuu'+'\0' = 27 bytes
|
||||
struct tm tm;
|
||||
localtime_r(&tv.tv_sec, &tm);
|
||||
//tv.tv_sec may not be of type time_t.
|
||||
time_t timesec = tv.tv_sec;
|
||||
localtime_r(×ec, &tm);
|
||||
size_t dateLength =
|
||||
strftime(datestr, sizeof(datestr), "%Y-%m-%d %H:%M:%S", &tm);
|
||||
assert(dateLength <= (size_t)20);
|
||||
|
|
Loading…
Reference in New Issue