Commit 638d2065 by Tristan Gingold Committed by Tristan Gingold

expr.c (interpret_float_suffix): Add a guard.

2012-05-10  Tristan Gingold  <gingold@adacore.com>

	* expr.c (interpret_float_suffix): Add a guard.

From-SVN: r187364
parent 3ac8781c
2012-05-10 Tristan Gingold <gingold@adacore.com>
* expr.c (interpret_float_suffix): Add a guard.
2012-05-02 Dodji Seketeli <dodji@redhat.com> 2012-05-02 Dodji Seketeli <dodji@redhat.com>
Properly initialize cpp_context in destringize_and_run Properly initialize cpp_context in destringize_and_run
......
...@@ -110,12 +110,13 @@ interpret_float_suffix (const uchar *s, size_t len) ...@@ -110,12 +110,13 @@ interpret_float_suffix (const uchar *s, size_t len)
} }
/* Recognize a fixed-point suffix. */ /* Recognize a fixed-point suffix. */
switch (s[len-1]) if (len != 0)
{ switch (s[len-1])
case 'k': case 'K': flags = CPP_N_ACCUM; break; {
case 'r': case 'R': flags = CPP_N_FRACT; break; case 'k': case 'K': flags = CPP_N_ACCUM; break;
default: break; case 'r': case 'R': flags = CPP_N_FRACT; break;
} default: break;
}
/* Continue processing a fixed-point suffix. The suffix is case /* Continue processing a fixed-point suffix. The suffix is case
insensitive except for ll or LL. Order is significant. */ insensitive except for ll or LL. Order is significant. */
......
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