diff options
author | ryde <ryde@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-01-10 21:31:31 +0000 |
---|---|---|
committer | ryde <ryde@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-01-10 21:31:31 +0000 |
commit | 0a980bc227e2baa7afed2997d07df776d04c2dc0 (patch) | |
tree | db25d0f81722d6ef0fd7c824eba1087e895b9262 /tests/trandom.c | |
parent | 7a3eaecb001b55a93e308733ec2eed6916e33c11 (diff) | |
download | mpfr-0a980bc227e2baa7afed2997d07df776d04c2dc0.tar.gz |
Tolerate empty argv[1], which can arise from ancient bash executing
the libtool shared library wrapper script.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2159 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/trandom.c')
-rw-r--r-- | tests/trandom.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/trandom.c b/tests/trandom.c index eb452a82d..cab79ea4d 100644 --- a/tests/trandom.c +++ b/tests/trandom.c @@ -202,8 +202,15 @@ main (int argc, char *argv[]) tests_start_mpfr (); if (argc > 1) verbose = 1; - - if (argc == 1) { nbtests = 10000; } else nbtests = atoi(argv[1]); + + nbtests = 10000; + if (argc > 1) + { + int a = atoi(argv[1]); + if (a != 0) + nbtests = a; + } + if (argc <= 2) { prec = 1000; } else prec = atoi(argv[2]); test_random (nbtests, prec, verbose); |