From 88957973320859a850084aca00c576ebdf1f82e7 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sat, 17 Sep 2005 11:20:25 +0000 Subject: [PATCH] Fix "numberf" function to correctly handle 'g' format specifier. Debugged by Michael Fritscher . svn path=/trunk/; revision=17894 --- reactos/lib/crt/stdio/vfprintf.c | 2 ++ reactos/lib/crt/stdio/vfwprint.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reactos/lib/crt/stdio/vfprintf.c b/reactos/lib/crt/stdio/vfprintf.c index a00e981fe40..8e0ebdaea7c 100644 --- a/reactos/lib/crt/stdio/vfprintf.c +++ b/reactos/lib/crt/stdio/vfprintf.c @@ -225,6 +225,8 @@ static int numberf(FILE * f, double __n, char exp_sign, int size, int precision type |= ZEROTRUNC; if ( exponent < -4 || fabs(exponent) >= precision ) exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; } if ( exp_sign == 'e' || exp_sign == 'E' ) { diff --git a/reactos/lib/crt/stdio/vfwprint.c b/reactos/lib/crt/stdio/vfwprint.c index 92040f3c8a1..a3a955b673f 100644 --- a/reactos/lib/crt/stdio/vfwprint.c +++ b/reactos/lib/crt/stdio/vfwprint.c @@ -238,6 +238,8 @@ static int numberf(FILE * f, double __n, wchar_t exp_sign, int size, int precis type |= ZEROTRUNC; if ( exponent < -4 || fabs(exponent) >= precision ) exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; } if ( exp_sign == L'e' || exp_sign == L'E' ) {