From af9f7df6d22903be7f7a7c8a93d77355bbd7f958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 15 Jul 2014 15:35:48 +0000 Subject: Facebook: Fix initializing random generator git-svn-id: http://svn.miranda-ng.org/main/trunk@9808 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/main.cpp | 3 +++ protocols/FacebookRM/src/utils.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols/FacebookRM') diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp index 598dc2b5b9..8aa058ec4d 100644 --- a/protocols/FacebookRM/src/main.cpp +++ b/protocols/FacebookRM/src/main.cpp @@ -115,6 +115,9 @@ extern "C" int __declspec(dllexport) Load(void) agent << __VERSION_STRING_DOTS; g_strUserAgent = agent.str(); + // Initialize random generator + srand(::time(NULL)); + return 0; } diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp index 23f4ff4417..115a5d4350 100644 --- a/protocols/FacebookRM/src/utils.cpp +++ b/protocols/FacebookRM/src/utils.cpp @@ -449,7 +449,6 @@ std::string utils::text::rand_string(int len, const char *chars) { std::stringstream out; - srand(::time(NULL)); for (int i = 0; i < len; ++i) { out << chars[utils::number::random(0, (int)strlen(chars))]; } -- cgit v1.2.3