aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-24 10:40:38 +0000
committerYang Tse <yangsita@gmail.com>2008-08-24 10:40:38 +0000
commitbc69e46ad112ff3680a18f6c5361894d74194e80 (patch)
treee0874f0193f9fa626f6526e815d1a5bc390ee7b4
parent13f035b905610abf9ac84686f1c5bc47a4d3b007 (diff)
x86_64 fixes
-rw-r--r--lib/mprintf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mprintf.c b/lib/mprintf.c
index 1e5235769..1bbf53ade 100644
--- a/lib/mprintf.c
+++ b/lib/mprintf.c
@@ -776,10 +776,11 @@ static int dprintf_formatf(
/* Decimal integer. */
base = 10;
- is_neg = (p->data.num.as_signed < (mp_intmax_t)0) ? 1 : 0;
+ signed_num = p->data.num.as_signed;
+ is_neg = (signed_num < (mp_intmax_t)0) ? 1 : 0;
if(is_neg) {
/* signed_num might fail to hold absolute negative minimum by 1 */
- signed_num = p->data.num.as_signed + (mp_intmax_t)1;
+ signed_num += (mp_intmax_t)1;
signed_num = -signed_num;
num = (mp_uintmax_t)signed_num;
num += (mp_uintmax_t)0x1;