summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_read_radix.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-05-10 17:20:39 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-05-10 17:20:39 (GMT)
commit5b510b75ec4a1d6fb55691bcf55dbf4b0b936624 (patch)
tree2a8c6a5370bc1ab79e9ed6d477146fe18604eb59 /libtommath/bn_mp_read_radix.c
parent6bc86f4b98c36219302ec99939666f84264bc4da (diff)
downloadtcl-5b510b75ec4a1d6fb55691bcf55dbf4b0b936624.zip
tcl-5b510b75ec4a1d6fb55691bcf55dbf4b0b936624.tar.gz
tcl-5b510b75ec4a1d6fb55691bcf55dbf4b0b936624.tar.bz2
committed local libtommath changes from kennykb-numerics-branch back to the Tcl HEAD
Diffstat (limited to 'libtommath/bn_mp_read_radix.c')
-rw-r--r--libtommath/bn_mp_read_radix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c
index 1ec3937..1e272fb 100644
--- a/libtommath/bn_mp_read_radix.c
+++ b/libtommath/bn_mp_read_radix.c
@@ -69,6 +69,13 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
++str;
}
+ /* if an illegal character was found, fail. */
+
+ if ( *str != '\0' ) {
+ mp_zero( a );
+ return MP_VAL;
+ }
+
/* set the sign only if a != 0 */
if (mp_iszero(a) != 1) {
a->sign = neg;