summaryrefslogtreecommitdiff
path: root/INSTALL
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2000-04-23 18:07:46 +0200
committerKevin Ryde <user42@zip.com.au>2000-04-23 18:07:46 +0200
commite9cb85d8301963e1bc5e6dd60a8b5f5f31c218c4 (patch)
tree67fafc10cb14e5583822551fb39fa5c6e9d57e4a /INSTALL
parent93a631eed82709b36754b9dc4b1e9f123f7f419a (diff)
downloadgmp-e9cb85d8301963e1bc5e6dd60a8b5f5f31c218c4.tar.gz
* INSTALL: Add arg count check to example programs.
Diffstat (limited to 'INSTALL')
-rw-r--r--INSTALL6
1 files changed, 6 insertions, 0 deletions
diff --git a/INSTALL b/INSTALL
index 9eecc4c1d..9c1375813 100644
--- a/INSTALL
+++ b/INSTALL
@@ -33,6 +33,9 @@ command line, multiplies them, and prints the result to stdout.
{
mpz_t a, b, p;
+ /* Expect 2 command line parameters */
+ if (argc < 3) exit (1);
+
/* Initialize variables */
mpz_init (a);
mpz_init (b);
@@ -70,6 +73,9 @@ MP user:
{
mpz_t a, b, p;
+ /* Expect 2 command line parameters */
+ if (argc < 3) exit (1);
+
/* Initialize and assign a and b from base 10 strings in argv */
mpz_init_set_str (a, argv[1], 10);
mpz_init_set_str (b, argv[2], 10);