Subject: bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

From: Torbjorn Granlund <[email-masked]>
Date: Thu, 06 Sep 2012 22:29:24 +0200

Jim Meyering <[email-masked]> writes:

      zsh: abort (core dumped)  ./factor < k
  
  That was due to unexpected input.

The parsing of the new factor is probably not too bad, but the error
reporting could be better.  :o)

  --- a/ourseq.c
  +++ b/ourseq.c
  @@ -48,7 +48,7 @@ incr (string *st)
   	}
         s[i] = '0';
       }
  -  memmove (s + 1, s, len);
  +  memmove (s + 1, s, len + 1);
     s[0] = '1';
     st->len = len + 1;
   }

Thanks.  Culpa mea, ourseq is not my finest work, just a hack for
testing factor.

-- 
Torbjörn