]> git.itanic.dy.fi Git - sudoku/commitdiff
random.cpp: Return better random numbers master
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 29 Dec 2009 09:36:28 +0000 (11:36 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 29 Dec 2009 09:36:28 +0000 (11:36 +0200)
In case of empty random number buffer, an appropriate random number
needs to be returned after the buffer is filled.

random.cpp

index 0585078fe6a0ad9678a7ed3d7649cf65143485ef..f59b0cfcf50365b655cc5ccc66a99e42252162ee 100644 (file)
@@ -43,5 +43,6 @@ unsigned int get_random(void)
        } while (i < RAND_BUF_SIZE * sizeof(rndbuf[0]));
        index = 0;
  out:
+       return get_random();
        close(fd);
 }