diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-08-30 11:20:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-08-30 11:20:19 (GMT) |
commit | d1a565fde90f8805d8e50073455049f92bef1d43 (patch) | |
tree | ebb1443471f7f12938ec55ce3b4a7f5ead28c781 /libtommath/bn_mp_read_radix.c | |
parent | 3a2a78a48a0eeea16928dca431306167ed6cddaa (diff) | |
download | tcl-d1a565fde90f8805d8e50073455049f92bef1d43.zip tcl-d1a565fde90f8805d8e50073455049f92bef1d43.tar.gz tcl-d1a565fde90f8805d8e50073455049f92bef1d43.tar.bz2 |
Cherry-pick [https://github.com/libtom/libtommath/commit/a0a86c696a7182f8be4b10bb79a1c5c971dc9561]: Merge branch 'tcl-fixes' into develop
Remove many files, which are not used in Tcl.
Modify "changelog.txt", with real release-date of 1.0.1 version
Diffstat (limited to 'libtommath/bn_mp_read_radix.c')
-rw-r--r-- | libtommath/bn_mp_read_radix.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libtommath/bn_mp_read_radix.c b/libtommath/bn_mp_read_radix.c index 03384e3..a4d1c8a 100644 --- a/libtommath/bn_mp_read_radix.c +++ b/libtommath/bn_mp_read_radix.c @@ -71,7 +71,13 @@ int mp_read_radix (mp_int * a, const char *str, int radix) } ++str; } - + + /* if an illegal character was found, fail. */ + if (!(*str == '\0' || *str == '\r' || *str == '\n')) { + mp_zero(a); + return MP_VAL; + } + /* set the sign only if a != 0 */ if (mp_iszero(a) != MP_YES) { a->sign = neg; |