summaryrefslogtreecommitdiff
path: root/tests/misc.c
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2004-09-20 02:57:29 +0200
committertege <tege@gmplib.org>2004-09-20 02:57:29 +0200
commit2ad2642b532f5fd18ee5f599fb049818511c4a5f (patch)
tree7fe7aeeef8d4a95b809ed04d964950bbb584c505 /tests/misc.c
parent363d8d03b20f7965597508f319f3af6a502417b6 (diff)
downloadgmp-2ad2642b532f5fd18ee5f599fb049818511c4a5f.tar.gz
(tests_rand_start): Default to strtoul for re-seeding.
Diffstat (limited to 'tests/misc.c')
-rw-r--r--tests/misc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/misc.c b/tests/misc.c
index adb489f3f..8e69945e6 100644
--- a/tests/misc.c
+++ b/tests/misc.c
@@ -87,7 +87,13 @@ tests_rand_start (void)
perform_seed = getenv ("GMP_CHECK_RANDOMIZE");
if (perform_seed != NULL)
{
+#ifdef HAVE_STRTOUL
+ seed = strtoul (perform_seed, 0, 0);
+#else
+ /* This will not work right for seeds >= 2^31 on 64-bit machines.
+ Perhaps use atol unconditionally? Is that ubiquitous? */
seed = atoi (perform_seed);
+#endif
if (! (seed == 0 || seed == 1))
{
printf ("Re-seeding with GMP_CHECK_RANDOMIZE=%lu\n", seed);