Index: boost/random/mersenne_twister.hpp =================================================================== --- boost/random/mersenne_twister.hpp (revision 73633) +++ boost/random/mersenne_twister.hpp (working copy) @@ -175,7 +175,7 @@ // fix up the state if it's all zeroes. if((x[0] & (~static_cast(0) << r)) == 0) { - for(std::size_t j = 1; i < n; ++j) { + for(std::size_t j = 1; j < n; ++j) { if(x[j] != 0) return; } x[0] = static_cast(1) << (w-1);