Commit ecb36604 by Tom Tromey Committed by Tom Tromey

* gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.

From-SVN: r33261
parent f64bedbd
2000-04-19 Tom Tromey <tromey@cygnus.com>
* gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
......
......@@ -407,12 +407,15 @@ cxx_keyword_subst (str, length)
{
int last = sizeof (cxx_keywords) / sizeof (const char *);
int first = 0;
int mid, r;
int mid = (last + first) / 2;
int old = -1;
while (last != first)
for (mid = (last + first) / 2;
mid != old;
old = mid, mid = (last + first) / 2)
{
mid = (last + first) / 2;
r = utf8_cmp (str, length, cxx_keywords[mid]);
int r = utf8_cmp (str, length, cxx_keywords[mid]);
if (r == 0)
{
char *str = xmalloc (9 + strlen (cxx_keywords[mid]));
......
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