From: Michael Vogt Date: Mon, 14 Mar 2011 15:40:29 +0000 (+0100) Subject: methods/mirror.cc: init random seed at startup X-Git-Tag: 0.8.13~1^2~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/0190e315a34377c658fa3acb5c658a6b4a52ae1e?ds=sidebyside methods/mirror.cc: init random seed at startup --- diff --git a/methods/mirror.cc b/methods/mirror.cc index 08a603207..ed42cdbfb 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -157,7 +157,7 @@ bool MirrorMethod::RandomizeMirrorFile(string mirror_file) // read ifstream in(mirror_file.c_str()); - while ( ! in.eof() ) { + while ( !in.eof() ) { getline(in, line); content.push_back(line); } @@ -403,6 +403,8 @@ int main() { setlocale(LC_ALL, ""); + srand ( time(NULL) ); + MirrorMethod Mth; return Mth.Loop();