Make QTemporaryDir file name more random
authorKai Koehne <kai.koehne@digia.com>
Wed, 11 Dec 2013 12:14:18 +0000 (13:14 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 12 Dec 2013 12:57:01 +0000 (13:57 +0100)
commit70c70aef7ee35009bb00614fdd6d4d282f9c4e57
treece5bfc4a13a045b40ae64f85c4fea07b123c262f
parent4d8a12904a49d6724098610f7e39b11821377b3a
Make QTemporaryDir file name more random

qrand() returns a number between 0 and RAND_MAX, which is only
guaranteed to be bigger than 32767. Dividing it repeatedly means
that the last bytes are always 0.

[ChangeLog][QtCore][QTemporaryDir] Fixed bug in QTemporaryDir name generator that dramatically
reduced randomness of the name.

Change-Id: I90613a652e6384296aed827e2714fe63cd8797ee
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
src/corelib/io/qtemporarydir.cpp