mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fix "numberf" function to correctly handle 'g' format specifier. Debugged by Michael Fritscher <michael@fritscher.net>.
svn path=/trunk/; revision=17894
This commit is contained in:
parent
bd4bdb08c1
commit
8895797332
2 changed files with 4 additions and 0 deletions
|
@ -225,6 +225,8 @@ static int numberf(FILE * f, double __n, char exp_sign, int size, int precision
|
||||||
type |= ZEROTRUNC;
|
type |= ZEROTRUNC;
|
||||||
if ( exponent < -4 || fabs(exponent) >= precision )
|
if ( exponent < -4 || fabs(exponent) >= precision )
|
||||||
exp_sign -= 2; // g -> e and G -> E
|
exp_sign -= 2; // g -> e and G -> E
|
||||||
|
else
|
||||||
|
exp_sign = 'f';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( exp_sign == 'e' || exp_sign == 'E' ) {
|
if ( exp_sign == 'e' || exp_sign == 'E' ) {
|
||||||
|
|
|
@ -238,6 +238,8 @@ static int numberf(FILE * f, double __n, wchar_t exp_sign, int size, int precis
|
||||||
type |= ZEROTRUNC;
|
type |= ZEROTRUNC;
|
||||||
if ( exponent < -4 || fabs(exponent) >= precision )
|
if ( exponent < -4 || fabs(exponent) >= precision )
|
||||||
exp_sign -= 2; // g -> e and G -> E
|
exp_sign -= 2; // g -> e and G -> E
|
||||||
|
else
|
||||||
|
exp_sign = 'f';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( exp_sign == L'e' || exp_sign == L'E' ) {
|
if ( exp_sign == L'e' || exp_sign == L'E' ) {
|
||||||
|
|
Loading…
Reference in a new issue