x86_64 fixes
authorYang Tse <yangsita@gmail.com>
Sun, 24 Aug 2008 10:40:38 +0000 (10:40 +0000)
committerYang Tse <yangsita@gmail.com>
Sun, 24 Aug 2008 10:40:38 +0000 (10:40 +0000)
lib/mprintf.c

index 1e52357..1bbf53a 100644 (file)
@@ -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;