mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Initialize the random number generator
We use random numbers for file names, both temporary filename when creating a zip for divelogs.de upload and for filename on form data for facebook upload. This does not require for true randomness but we still want these to not be constant on each run of Subsurface. Thus we need to initialize the random number generator. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d5f2bb2353
commit
55fbddb756
1 changed files with 8 additions and 0 deletions
8
main.cpp
8
main.cpp
|
|
@ -58,6 +58,14 @@ int main(int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
git_libgit2_init();
|
git_libgit2_init();
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
* Initialize the random number generator - not really secure as
|
||||||
|
* this is based only on current time, but it should not matter
|
||||||
|
* that much in our context. Moreover this is better than
|
||||||
|
* the constant numbers we used to get before.
|
||||||
|
*/
|
||||||
|
qsrand(time(NULL));
|
||||||
|
|
||||||
setup_system_prefs();
|
setup_system_prefs();
|
||||||
copy_prefs(&default_prefs, &prefs);
|
copy_prefs(&default_prefs, &prefs);
|
||||||
fill_profile_color();
|
fill_profile_color();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue