From 8e6a76a58c56d0d045e6b2b720fbc35d2e72d2f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Mon, 23 Apr 2012 18:23:05 +0200
Subject: Seed the random number generator.


diff --git a/Swiften/Base/BoostRandomGenerator.cpp b/Swiften/Base/BoostRandomGenerator.cpp
index 62c3055..e58ec95 100644
--- a/Swiften/Base/BoostRandomGenerator.cpp
+++ b/Swiften/Base/BoostRandomGenerator.cpp
@@ -12,6 +12,11 @@
 
 namespace Swift {
 
+BoostRandomGenerator::BoostRandomGenerator() {
+	// FIXME: Not a good seed
+	generator.seed(static_cast<unsigned int>(std::time(0)));
+}
+
 int BoostRandomGenerator::generateRandomInteger(int maximum) {
 	boost::uniform_int<> distribution(0, maximum);
 	return distribution(generator);
diff --git a/Swiften/Base/BoostRandomGenerator.h b/Swiften/Base/BoostRandomGenerator.h
index 6d65b0b..b5a6cac 100644
--- a/Swiften/Base/BoostRandomGenerator.h
+++ b/Swiften/Base/BoostRandomGenerator.h
@@ -13,6 +13,8 @@
 namespace Swift {
 	class BoostRandomGenerator : public RandomGenerator{
 		public:
+			BoostRandomGenerator();
+
 			int generateRandomInteger(int max);
 
 		private:
-- 
cgit v0.10.2-6-g49f6