Correction by Jens Rohler <jkcr@rohler.de>
[infodrom/dtaus] / bigint.c
index 38511aa..1b6fa91 100644 (file)
--- a/bigint.c
+++ b/bigint.c
@@ -1,6 +1,6 @@
 /*
     bigint.c - Manage big positive integer numbers
 /*
     bigint.c - Manage big positive integer numbers
-    Copyright (c) 1996,2001  Martin Schulze <joey@artis.uni-oldenburg.de>
+    Copyright (c) 1996,2001,5  Martin Schulze <joey@infodrom.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ bigint bigint_add(bigint a, bigint b)
     tmp = a.val[i] + b.val[i];
     if (tmp >= BIGINT_MAX) {
       c.val[i] = tmp - BIGINT_MAX;
     tmp = a.val[i] + b.val[i];
     if (tmp >= BIGINT_MAX) {
       c.val[i] = tmp - BIGINT_MAX;
-      if (i<BIGINT_LEN)
+      if (i<BIGINT_LEN-1)
        a.val[i+1]++;
       else
        fprintf(stderr, "Overflow in bigint addition.");
        a.val[i+1]++;
       else
        fprintf(stderr, "Overflow in bigint addition.");