summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-10-29 14:28:45 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-10-29 14:33:56 (GMT)
commit198b974587ba9751a2bdc73464c05c164d49f10c (patch)
tree3bfc6a60d3c8434b6571748a0011a67adfea18a2
parent76095a14bc84305c69b3eaf8f3953dc683ebe370 (diff)
downloadQt-198b974587ba9751a2bdc73464c05c164d49f10c.zip
Qt-198b974587ba9751a2bdc73464c05c164d49f10c.tar.gz
Qt-198b974587ba9751a2bdc73464c05c164d49f10c.tar.bz2
Fixed: Variable res goes out of scope but is accessed later via pointer
In qdatetime UTC conversion functions, variable res was declared in incorrect scope and went out of scope too soon in Symbian. Reviewed-by: Janne Koskinen
-rw-r--r--src/corelib/tools/qdatetime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 54465bb..db6435e 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1855,7 +1855,7 @@ QTime QTime::currentTime()
t = localtime(&ltime);
#endif
Q_CHECK_PTR(t);
-
+
ct.mds = MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1000 * t->tm_sec
+ tv.tv_usec / 1000;
#else
@@ -3725,11 +3725,11 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time)
TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
TTime epochTTime;
TInt err = epochTTime.Set(KUnixEpoch);
+ tm res;
if(err == KErrNone) {
TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
utcTTime = utcTTime + utcOffset;
TDateTime utcDateTime = utcTTime.DateTime();
- tm res;
res.tm_sec = utcDateTime.Second();
res.tm_min = utcDateTime.Minute();
res.tm_hour = utcDateTime.Hour();
@@ -3816,11 +3816,11 @@ static void localToUtc(QDate &date, QTime &time, int isdst)
TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC);
TTime epochTTime;
TInt err = epochTTime.Set(KUnixEpoch);
+ tm res;
if(err == KErrNone) {
TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC;
utcTTime = utcTTime + utcOffset;
TDateTime utcDateTime = utcTTime.DateTime();
- tm res;
res.tm_sec = utcDateTime.Second();
res.tm_min = utcDateTime.Minute();
res.tm_hour = utcDateTime.Hour();