Pádraig Brady
024a1d572c
factor: fix integer validation and GMP fallback
...
In the recent factor rewrite, the GMP code
wasn't actually used; just an error was printed
on integer overflow. While fixing that it was noticed
that correct input validation wasn't done in all cases
when falling back to the GMP code.
* src/factor.c (print_factors) Fallback to GMP on overflow.
(strto2uintmax): Scan the string for invalid characters,
so that case can be detected independently of overflow.
Return an error when an empty string is passed.
Also allow leading spaces and '+' in input numbers.
* tests/misc/factor.pl: Ensure the GMP code is exercised
when compiled in. Also add a test to verify leading
spaces and '+' are allowed.
2012-10-09 00:07:35 +01:00
..
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-10-09 00:07:35 +01:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-16 11:41:50 +01:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-14 13:34:51 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00
2012-09-05 08:48:29 +02:00
2012-08-30 18:55:59 +02:00