Commit d134aa59 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Fix scanf handling of float numbers (beginning with a dot).

parent c4be01a7
......@@ -262,16 +262,20 @@ _FUNCTION_ {
nch = _GETC_(file);
}
/* get first digit. */
if (!_ISDIGIT_(nch)) break;
cur = (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
if ('.' != nch) {
if (!_ISDIGIT_(nch)) break;
cur = (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
/* read until no more digits */
while (width!=0 && (nch!=_EOF_) && _ISDIGIT_(nch)) {
cur = cur*10 + (nch - '0');
nch = _GETC_(file);
if (width>0) width--;
}
}
} else {
cur = 0; /* MaxPayneDemo Fix: .8 -> 0.8 */
}
/* handle decimals */
if (width!=0 && nch == '.') {
float dec = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment