diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-05-02 04:23:52 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-05-02 04:23:52 +0000 |
commit | 844aafb1181b3b2f402a080a1fa187f00b30b6b3 (patch) | |
tree | 0fbb4a87a454857947fb52930dcc214a9cb3ae64 /dev-libs/gmp/files | |
parent | old (diff) | |
download | historical-844aafb1181b3b2f402a080a1fa187f00b30b6b3.tar.gz historical-844aafb1181b3b2f402a080a1fa187f00b30b6b3.tar.bz2 historical-844aafb1181b3b2f402a080a1fa187f00b30b6b3.zip |
Add fix from upstream.
Package-Manager: portage-2.2_pre5
Diffstat (limited to 'dev-libs/gmp/files')
-rw-r--r-- | dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff b/dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff new file mode 100644 index 000000000000..9ea58b9f0384 --- /dev/null +++ b/dev-libs/gmp/files/4.2.2/mpf_set_str.c.diff @@ -0,0 +1,38 @@ +*** mpf/set_str.c 30 Aug 2007 18:19:41 -0000 +--- mpf/set_str.c 10 Dec 2007 04:47:18 -0000 +*************** mpf_set_str (mpf_ptr x, const char *str, +*** 272,277 **** + + if (expptr != 0) +! /* FIXME: Should do some error checking here. */ +! exp_in_base = strtol (expptr, (char **) 0, exp_base); + else + exp_in_base = 0; +--- 272,298 ---- + + if (expptr != 0) +! { +! /* Scan and convert the exponent, in base exp_base. */ +! long dig, neg = -(long) ('-' == expptr[0]); +! expptr -= neg; /* conditional increment */ +! c = (unsigned char) *expptr++; +! dig = digit_value[c]; +! if (dig >= exp_base) +! { +! TMP_FREE; +! return -1; +! } +! exp_in_base = dig; +! c = (unsigned char) *expptr++; +! dig = digit_value[c]; +! while (dig < exp_base) +! { +! exp_in_base = exp_in_base * exp_base; +! exp_in_base += dig; +! c = (unsigned char) *expptr++; +! dig = digit_value[c]; +! } +! exp_in_base = (exp_in_base ^ neg) - neg; /* conditional negation */ +! } + else + exp_in_base = 0; |