Modulus of negative dividends is undefined or negative
authorJoão Abecasis <joao.abecasis@nokia.com>
Fri, 5 Aug 2011 08:30:32 +0000 (10:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 20 Oct 2011 02:23:33 +0000 (04:23 +0200)
... depending on who you ask. Since it is possible for applicationPid to
return negative values this means we would introduce garbage ['()*+,-./]
in the generated filenames.

Reviewed-by: Denis Dzyubenko
(cherry picked from commit cb7cb1d3884ae8a032f3ad2ed3a6d8e3ffc06206)

Change-Id: Ie4f74b961397f97508ea67a0c835e45773d1cc0e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
src/corelib/io/qtemporaryfile.cpp

index ad7d7e6..d9b1143 100644 (file)
@@ -118,7 +118,7 @@ static int createFileFromTemplate(char *const path,
         char *rIter = placeholderEnd;
 
 #if defined(QT_BUILD_CORE_LIB)
-        qint64 pid = QCoreApplication::applicationPid();
+        quint64 pid = quint64(QCoreApplication::applicationPid());
         do {
             *--rIter = (pid % 10) + '0';
             pid /= 10;