Fixed missed initialization of struct tm in Logger::timeStamp sandbox/akazmin/tizen_6.0_build
authorAndrey Kazmin <a.kazmin@partner.samsung.com>
Mon, 23 Dec 2019 10:32:58 +0000 (13:32 +0300)
committerAndrey Kazmin <a.kazmin@partner.samsung.com>
Mon, 23 Dec 2019 10:37:29 +0000 (13:37 +0300)
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
core/Logger/Logger.cpp

index 96c1e9b91e750ff8232ac008c64bdbb6e1151efb..2394c5a9927dbc55a250bb753b0b15bc7fb04a71 100755 (executable)
@@ -155,13 +155,15 @@ int Logger::registerLogger(AbstractLogger *l) {
 }
 
 std::string Logger::timeStamp() {
-        struct tm b;
+        struct tm *b;
         struct timeval detail_time;
+
         gettimeofday(&detail_time, NULL);
+        b = gmtime(&detail_time.tv_sec);
 
         char buf[80];
 //     strftime(buf, sizeof(buf), "%d/%m/%y,%T ", brokenTime, detail_time.tv_usec/1000);
-        snprintf(buf, sizeof(buf), "[%d/%d/%d,%d:%d:%d.%ld]", b.tm_year, b.tm_mon, b.tm_mday, b.tm_hour, b.tm_min, b.tm_sec, detail_time.tv_usec/1000);
+        snprintf(buf, sizeof(buf), "[%d/%d/%d,%d:%d:%d.%ld]", b->tm_year, b->tm_mon, b->tm_mday, b->tm_hour, b->tm_min, b->tm_sec, detail_time.tv_usec/1000);
         return std::string(buf);
 }