diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-06-29 13:49:29 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2009-06-29 14:02:51 (GMT) |
commit | cb7d8c7a199a6b9162b4d8181a3f9599a787fd9a (patch) | |
tree | 59e99a5abe916a4c9171b045cac0da6ac64249a0 | |
parent | 82c48b13249fbcd96d8287f3cd1fdfd61802523c (diff) | |
download | Qt-cb7d8c7a199a6b9162b4d8181a3f9599a787fd9a.zip Qt-cb7d8c7a199a6b9162b4d8181a3f9599a787fd9a.tar.gz Qt-cb7d8c7a199a6b9162b4d8181a3f9599a787fd9a.tar.bz2 |
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
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 3 |
1 files changed, 1 insertions, 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; |