From 5bc3d359423f37a16dadb367fc49c72cbf66b9d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Fri, 29 Nov 1996 20:02:07 +0100
Subject: [PATCH] Fixed typo in low_get_digits()

Rev: src/modules/gmpmod/mpz_glue.c:1.12
---
 src/modules/gmpmod/mpz_glue.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/modules/gmpmod/mpz_glue.c b/src/modules/gmpmod/mpz_glue.c
index d15900eb82..7aed5ff099 100644
--- a/src/modules/gmpmod/mpz_glue.c
+++ b/src/modules/gmpmod/mpz_glue.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: mpz_glue.c,v 1.11 1996/11/23 00:08:56 hubbe Exp $");
+RCSID("$Id: mpz_glue.c,v 1.12 1996/11/29 19:02:07 nisse Exp $");
 #include "gmp_machine.h"
 #include "types.h"
 
@@ -159,7 +159,7 @@ static struct pike_string *low_get_digits(MP_INT *mpz, int base)
   }
   else if (base == 256)
   {
-    INT8 i;
+    INT32 i;
     mpz_t tmp;
     
     if (mpz_sgn(mpz) < 0)
@@ -167,7 +167,8 @@ static struct pike_string *low_get_digits(MP_INT *mpz, int base)
     len = (mpz_sizeinbase(mpz, 2) + 7) / 8;
     s = begin_shared_string(len);
     mpz_init_set(tmp, mpz);
-    for (i = len - 1; i>= 0; i-- )
+    i = len;
+    while(i--)
     {
       s->str[i] = mpz_get_ui(tmp) & 0xff;
       mpz_tdiv_q_2exp(tmp, tmp, 8);
-- 
GitLab