Fix scanf handling of float numbers (beginning with a dot).
This commit is contained in:
parent
c4be01a745
commit
d134aa5945
|
@ -262,6 +262,7 @@ _FUNCTION_ {
|
|||
nch = _GETC_(file);
|
||||
}
|
||||
/* get first digit. */
|
||||
if ('.' != nch) {
|
||||
if (!_ISDIGIT_(nch)) break;
|
||||
cur = (nch - '0');
|
||||
nch = _GETC_(file);
|
||||
|
@ -272,6 +273,9 @@ _FUNCTION_ {
|
|||
nch = _GETC_(file);
|
||||
if (width>0) width--;
|
||||
}
|
||||
} else {
|
||||
cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */
|
||||
}
|
||||
/* handle decimals */
|
||||
if (width!=0 && nch == '.') {
|
||||
float dec = 1;
|
||||
|
|
Loading…
Reference in New Issue