From f41aef273b05a1ed7e2608f019bd8b5d6e561924 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 22 Oct 2007 19:37:36 -0700 Subject: [PATCH] Decimal floating point can also start with 0. 0e 0E A floating point number starting with 0. 0e or 0E is still decimal. Make it easier by falling back to the standard decimal conversion routine for anything not recognized as a radix prefix. --- float.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/float.c b/float.c index 7e99f96c..ca141999 100644 --- a/float.c +++ b/float.c @@ -676,16 +676,9 @@ static int to_float(const char *str, int sign, uint8_t * result, case 't': case 'T': ok = ieee_flconvert(str+2, mant, &exponent); break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case '\0': - /* Leading zero was just a zero */ - ok = ieee_flconvert(str, mant, &exponent); - break; default: - error(ERR_NONFATAL, - "floating-point constant: invalid radix `%c'", str[1]); - ok = false; + /* Leading zero was just a zero? */ + ok = ieee_flconvert(str, mant, &exponent); break; } } else if (str[0] == '$') {