From 0a980bc227e2baa7afed2997d07df776d04c2dc0 Mon Sep 17 00:00:00 2001 From: ryde Date: Fri, 10 Jan 2003 21:31:31 +0000 Subject: 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 --- tests/trandom.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') 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); -- cgit v1.2.1