[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gmp-devel
Subject:    small fix for mpz_set_str()
From:       tg () gmplib ! org (=?utf-8?Q?Torbj=C3=B6rn?= Granlund)
Date:       2018-02-19 12:05:38
Message-ID: 86vaetgp65.fsf () oshell ! gmplib ! org
[Download RAW message or body]

Trevor Spiteri <tspiteri at ieee.org> writes:

  This is a fix for the bug
  https://gmplib.org/list-archives/gmp-bugs/2018-February/004304.html
  
  Regards.
  
  Trevor Spiteri
  
  
  diff -r 164971d5c8d0 mpz/set_str.c
  --- a/mpz/set_str.c??? Sat Feb 10 18:05:32 2018 +0100
  +++ b/mpz/set_str.c??? Wed Feb 14 00:35:11 2018 +0100
  @@ -71,7 +71,9 @@
  ?? if (c == '-')
  ???? {
  ?????? negative = 1;
  -????? c = (unsigned char) *str++;
  +????? do
  +??????? c = (unsigned char) *str++;
  +????? while (isspace (c));
  ???? }
  ?
  ?? if (digit_value[c] >= (base == 0 ? 10 : base))
  
I believe the GMP developers discussed this some years ago, and IIRC we
decided not to skip more spaces.  The reason would be that we don't
consider the (documented) space skipping of mp{z,q,f}_set_str to be a
nice feature.

(We might want to update the documentation, though.)


-- 
Torbj?rn
Please encrypt, key id 0xC8601622

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic