From cb7d8c7a199a6b9162b4d8181a3f9599a787fd9a Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 29 Jun 2009 15:49:29 +0200 Subject: Initialize the time structure in QTime::currentTime() In QTime::currentTime(), the pointer to the tm structure was used without being initialized. Task-number: 256889 Reviewed-by: Markus Goetz --- src/corelib/tools/qdatetime.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 7dd9060..6674717 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1848,8 +1848,7 @@ QTime QTime::currentTime() #else time_t ltime; // no millisecond resolution ::time(<ime); - tm *t = 0; - localtime(<ime); + const tm *const t = localtime(<ime); ct.mds = MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1000 * t->tm_sec; #endif return ct; -- cgit v0.12